- Home /
Turning off rigidbody without turning the entire object inactive?
Is it possible to deactivate rigidbody without deactivating the entire gameobject?
obj.rigidbody.active = false;
seems to deactivate the entire object.. o.O
Answer by Kailas · Jan 01, 2012 at 01:10 PM
Setting a component's .active is actually setting the active state of the game object it is attached to (exactly what you are experiencing). using .enabled will do so for a specific component (what you want to do). However rigidbodies don't have an enabled property.
Setting the isKinematic bool to true will stop the object from doing normal rigidbody stuff (gravity, movement, bouncing off things etc). It is basically specifying that you have an object that you want to move around in code.
As far as I know, having an object with a collider but no rigidbody means that the object is treated as static collision geometry and it optimized as such. Moving such an object around means that the optimizations need to be performed again (which is far more inefficient than treating the object as movable and not doing the optimizations).,
It looks like is$$anonymous$$inematic is a hack for not having to Destroy then AddComponent again.
They achieve the same thing in this context yes. But destroying will make Unity treat the object's collider as static and ... what I said above. Could be useful if you wanted the object to move into a position then never move again or wait a long time before moving again I guess.
Your answer
Follow this Question
Related Questions
Check if object is applying force to another object 0 Answers
OnTriggerEnter triggers twice when changing the parent of a gameObject inside of a collider. 1 Answer
Articulation Bodies Vs Rigidbodies in Unity 2020 1 Answer
RIGIDBODY HOW MAKE IT STOP BOUNCING HELP! 3 Answers
Physics simulation problem 0 Answers