- Home /
My script will not let me enable RigidBody.
It is supposed to enable / disable isKinematic which it does do. But when kinematic = false, it shows that it equals false, but doesn't actually equal false. Then I click the checkbox to see what happens when I do it manually. It is still false, but now actually falls down like it is supposed to.
var RagdollSystem : GameObject;
var Stomach : GameObject; var Abs : GameObject; var Chest : GameObject; var LShoulder : GameObject; var LUpArm : GameObject; var LLowArm : GameObject; var RShoulder : GameObject; var RUpArm : GameObject; var RLowArm : GameObject; var Neck : GameObject; var LHip : GameObject; var LUpLeg : GameObject; var LLowLeg : GameObject; var LFoot : GameObject; var RHip : GameObject; var RUpLeg : GameObject; var RLowLeg : GameObject; var RFoot : GameObject; var FullB : GameObject;
function Start () {
}
function Update () {
if(Check == false) { RagdollSystem.GetComponent(Ragdoll).Ragdoll = false; } if(Check == true) { RagdollSystem.GetComponent(Ragdoll).Ragdoll = true; } if(Check == false) { Stomach.GetComponent(Rigidbody).isKinematic = true; Abs.GetComponent(Rigidbody).isKinematic = true; Chest.GetComponent(Rigidbody).isKinematic = true; LShoulder.GetComponent(Rigidbody).isKinematic = true; LUpArm.GetComponent(Rigidbody).isKinematic = true; LLowArm.GetComponent(Rigidbody).isKinematic = true; RShoulder.GetComponent(Rigidbody).isKinematic = true; RUpArm.GetComponent(Rigidbody).isKinematic = true; RLowArm.GetComponent(Rigidbody).isKinematic = true; Neck.GetComponent(Rigidbody).isKinematic = true; LHip.GetComponent(Rigidbody).isKinematic = true; LUpLeg.GetComponent(Rigidbody).isKinematic = true; LLowLeg.GetComponent(Rigidbody).isKinematic = true; LFoot.GetComponent(Rigidbody).isKinematic = true; RHip.GetComponent(Rigidbody).isKinematic = true; RUpLeg.GetComponent(Rigidbody).isKinematic = true; RLowLeg.GetComponent(Rigidbody).isKinematic = true; RFoot.GetComponent(Rigidbody).isKinematic = true; FullB.GetComponent(Rigidbody).isKinematic = true; } if(Check == true) { Stomach.GetComponent(Rigidbody).isKinematic = false; Abs.GetComponent(Rigidbody).isKinematic = false; Chest.GetComponent(Rigidbody).isKinematic = false; LShoulder.GetComponent(Rigidbody).isKinematic = false; LUpArm.GetComponent(Rigidbody).isKinematic = false; LLowArm.GetComponent(Rigidbody).isKinematic = false; RShoulder.GetComponent(Rigidbody).isKinematic = false; RUpArm.GetComponent(Rigidbody).isKinematic = false; RLowArm.GetComponent(Rigidbody).isKinematic = false; Neck.GetComponent(Rigidbody).isKinematic = false; LHip.GetComponent(Rigidbody).isKinematic = false; LUpLeg.GetComponent(Rigidbody).isKinematic = false; LLowLeg.GetComponent(Rigidbody).isKinematic = false; LFoot.GetComponent(Rigidbody).isKinematic = false; RHip.GetComponent(Rigidbody).isKinematic = false; RUpLeg.GetComponent(Rigidbody).isKinematic = false; RLowLeg.GetComponent(Rigidbody).isKinematic = false; RFoot.GetComponent(Rigidbody).isKinematic = false; FullB.GetComponent(Rigidbody).isKinematic = false; }
}
Answer by kblood · Feb 06, 2013 at 04:18 PM
I have had the same problem, and the solution I found was to also enable and disable gravity on the rigidbodies. Otherwise they just remain still in the air until something hits their collider.
You can also add zero force (with AddForce); they're currently asleep so they need to be woken up.
Your answer
![](https://koobas.hobune.stream/wayback/20220613081405im_/https://answers.unity.com/themes/thub/images/avi.jpg)