Skip to content

Instantly share code, notes, and snippets.

@ThinhHB
Last active May 3, 2016 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThinhHB/8a00906d998c6da4c393cc20725b4d2b to your computer and use it in GitHub Desktop.
Save ThinhHB/8a00906d998c6da4c393cc20725b4d2b to your computer and use it in GitHub Desktop.
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