- Home /
Disabling Kinematic on hit
I made a character with "Rigidbody" on each piece and made them all "Character Joints". "Is Kinematic" is turned on each body part to prevent them from going into the ragdoll state.
What I would like to do is make the entire body turn off "Is Kinematic" when a force hits it.
read "Sometimes you want an object to be under physics control but in another situation to be controlled explicitly from a script or animation. For example you could make an animated character whose bones have Rigidbodies attached that are connected with joints for use as a Ragdoll. Most of the time the character is under animation control, thus you make the Rigidbody Kinematic. But when he gets hit you want him to turn into a Ragdoll and be affected by physics. To accomplish this, you simply disable the isKinematic property."
-http://ws.cis.sojo-u.ac.jp/~izumi/Unity_Documentation_jp/Documentation/Manual/Physics.html
Can anyone help?
Answer by robertbu · Mar 13, 2014 at 08:46 PM
I'm having trouble understanding the root of your question. Is it simply how to iterate through your object and turn off the isKinematic flag?:
rbs = gameObject.GetComponentsInChildren(Rigidbody);
for (var rb : Rigidbody in rbs) {
rb.isKinematic = false;
}
Answer by EmretheGanjaRaiders · Oct 06, 2020 at 07:09 AM
if u use the animator controller the ragdoll goes deactivated when u disable the animator controller
Your answer
Follow this Question
Related Questions
Ragdollize kinematic rigidbodies 0 Answers
How to add force to broken pieces upon impact? 0 Answers
How to get Satisfying Collision Physics 1 Answer
How to add physics to an animation? 3 Answers