Detect if an object has stopped moving.

I’m moving an object using AddForwardForce …

In the FixedUpdate function I would like to make a conditional checking if the object has stopped moving or not. How can this be done?

one simple way:

if(rigidbody.velocity.sqrMagnitude < .01  rigidbody.angularVelocity.sqrMagnitude < .01)//much faster than magnitude

those numbers might be higher/lower than you need.

if you don’t need to know instantly when it isn’t moving, it might be better to check rigidbody.IsSleeping().

1 Like

thanks so much! that’s exactly what was needed.

Thanks - this worked for me too!