Created
September 25, 2012 19:59
-
-
Save markusrt/3784093 to your computer and use it in GitHub Desktop.
Platformer Controller in Air controls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var absoluteAirVelocity = Mathf.Abs(movement.inAirVelocity.x); | |
if (absoluteAirVelocity < movement.inAirMinSpeed) | |
{ | |
movement.inAirVelocity = Vector3(Mathf.Sign(h), 0, 0) | |
* movement.inAirMinSpeed; | |
} | |
else if (absoluteAirVelocity > movement.inAirMaxSpeed) | |
{ | |
movement.inAirVelocity = Vector3(Mathf.Sign(h), 0, 0) | |
* movement.inAirMaxSpeed; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment