Knowing when an object has stopped.

I have a ball with a rigidbody that I move by initially applying a force as so:

ball.rigidbody.AddForceAtPosition(force, point, ForceMode.VelocityChange);

I would like to know when the ball stops rolling. It is harder though than just checking if the velocity is zero (I think), because it rolls along slopes so it may move from one velocity to another, crossing zero in the middle (for example, rolls up, stops for a split second, then rolls back down). If I knew the acceleration at that time, this wouldn’t be a big deal since I’d just check if vel and accel were 0 (or within a threshold). As is however, its not clear to me how to check this (I don’t think I can ask the acceleration). I feel that I’m probably missing something obvious so any help would be appreciated.

Thanks!

All rigidbodies “fall asleep” when reaching a certain threshold, which you can set for each individual rigidbody. Maybe you can use the sleep functionality for your rolling ball?

Rigidbody sleeping documentation.

sleepVelocity documentation.

sleepAngularVelocity documentation.