- Home /
How to stop a physics object slowly
I have a car game in which the car uses the rigidbody.addforce to move the car and I have a braking system where you have the letter X as the brake key. I use the rigidbody.velocity(0, 0, 0) and the rigidbody.angularvelocity(0, 0, 0) to stop the car but when I push x it instantly stops the car instead of slowing the car down until it's static. it doesn't give a proper car vibe
Answer by CoreDLL · Mar 14, 2021 at 10:58 PM
When you brake set a very big value to Rigidbody.Drag. https://docs.unity3d.com/ScriptReference/Rigidbody-drag.html
Your answer
Follow this Question
Related Questions
Rigidbody2D adding force vs modifying velocity for character jump 1 Answer
Rigidbody.velocity seems to be breaking jumping physics 0 Answers
Any way to gracefully detach object with Unity physics? 2 Answers
Problems with Physics(Flipping strangely) 2 Answers
Setting a RigidBody's velocity messes with my custom gravity, not sure how to proceed. 0 Answers