Unity 5 rigidbody not falling asleep

In my game, in order to upgrade level, the objects (rigidbodies) have to be stopped.

I have a function that returns true if all the objets are sleeping (stopped).

This works fine in Unity 4 but, I’m upgrading my game to Unity 5 and it seems that my rigidbodies even when they are stopped the function “myObject.GetComponent().IsSleeping()” is always returning false, which is wrong. I know this by doing a debug log.

How can I solve this?

Thanks in advance!

Since the new version, I’ve noticed several small oddities with Physx and my guess would be that you have to adjust the sleep threshold in the physics manager: Edit/Project Settings/Physics. You very well could have tried this, but I do know the newer version of Physx has differences in scaling that has required me to refactor some of my code. Hope this helps!

You could set the rigidbodies to Kinematic, like here.

Easy usage:

GetComponent<Rigidbody>().isKinematic = true;

It completely stops the physics on the rigidbody, and you can check on an object easily aswell.

if(GetComponent<Rigidbody>().isKinematic)
{
    //...
}

Hope it helps.