Last active
May 3, 2016 09:12
-
-
Save ThinhHB/8a00906d998c6da4c393cc20725b4d2b to your computer and use it in GitHub Desktop.
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
public class MovementComponent : MonoBehaviour | |
{ | |
// Drag your movementConfig to here | |
public MovementConfig movementConfig; | |
void Update() | |
{ | |
var velo = _myRigidbody2D.velocity; | |
velo.x = movementConfig.limitVelocity; | |
_myRigidbody2D.velocity = velo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment