Can't Turn isKinematic Off

I want to change an object’s kinematic state from a script so that sometimes it’s under script control and sometimes it’s under physics control. But from a script all that works is setting isKinematic = true. Setting isKinematic = false from a script has no effect. Works both ways in the Inspector.

For example, I have a single object in the scene. If I run with isKinematic = false, it falls immediately. If I run with isKinematic = true, it does not move, as it should. But if I add a button that switches the state, it does not behave as I expect it to. If I run with isKinematic = false, the body starts falling but stops when I click the button to set isKinematic = true. But if I click again and set isKinematic = false, it does not start falling. But if I check the box in the Inspector, it starts falling again.

How can I change an object’s kinematic state from a script so that physics control resumes?

rigidbody.WakeUp( );

if a rigidbody is stationary (possibly due to isKinematic) then it gets culled by the physics engine as “Sleeping” because it has no velocity/energy. forcing it to Wake Up will get it goin.

Thanks, that did the trick. I guess when you use the Inspector to turn isKinematic off, it automatically does a WakeUp.