Stoping Momentum

Hi, i’m Making a platformer Based on Momentum and i was woundering if there is a way to make it and so if i press a key it stop all momentum compleatly and so i fall back down?

Any info would be good thx

Try this:

if (Input.GetKey(KeyCode.E))
	playerCharacter.rigidbody.velocity = 0

Take that, and slot it into your script. Replace KeyCode.E with whatever key you want, and change playerCharacter to whatever variable points to your player character’s GameObject.

Oh yeah, this code will work for angularVelocity too, so feel free to replace .velocity if you want.

Sure a Rigidbody is a physics-object. You can use forces to move / accelerate it.

To stop all momentum just set the Rigidbody’s .velocity and .angularVelocity to Vector3.zero.