- Home /
Object affected by gravity freezes after it comes to rest
I have a simple game I'm working on involving a flat surface and a sphere. the sphere rolls on the surface using gravity, and the surface is tilted by the arrow keys.
The problem I'm having is that if the sphere comes to rest on the surface, and the player tilts the surface, the sphere will "float" and not react as you would expect it to, which is continue rolling again.
If the player continues to rotate the surface until it hits the sphere, the sphere starts reacting to gravity again.
Is there some code or settings that forces an object to always react to gravity?
Answer by zombience · Aug 16, 2013 at 03:52 PM
In Unity, check your settings menu:
Edit > Project Settings > Physics
try lowering "Sleep Velocity" to a very small amount.
What is happening is that the rigidbody is being ignored after its velocity drops below the "Sleep" threshold. This is put in place to optimize performance when there are tons of rigidbodies in the scene.
It awakens again when some other object in the scene collides with it, bumping its velocity back above the sleep threshold