Does anyone know a workaround when it comes to disabling HingeJoint components in Unity? It's super strange that they removed that function, as you can do it with 2D hinge joints - It seems that they even removed rigidBody.enabled. I solved that with ".Sleep", but still, why is hingeJoint.enabled not a thing!?
Code:
if (!ragdoll) {
rigidBody.Sleep ();
for (int i = 0; i < ragdollParts.Length; i++) {
ragdollJoints [i].enabled = false;
}
}
That is what the code is supposed to do, but sadly, it only works with 2D joints!
EDIT: Turns out I didn't have to disable them, as the rigidbody was disabled it basically cancelled the hinge joint.
EDIT2: Nevermind, hinge joints still have to be disabled!
Does anyone know a workaround when it comes to disabling HingeJoint components in Unity? It's super strange that they removed that function, as you can do it with 2D hinge joints - It seems that they even removed rigidBody.enabled. I solved that with ".Sleep", but still, why is hingeJoint.enabled not a thing!?
[code] if (!ragdoll) {
rigidBody.Sleep ();
for (int i = 0; i < ragdollParts.Length; i++) {
ragdollJoints [i].enabled = false;
}
}[/code]
That is what the code is supposed to do, but sadly, it only works with 2D joints! :(
EDIT: Turns out I didn't have to disable them, as the rigidbody was disabled it basically cancelled the hinge joint.
EDIT2: Nevermind, hinge joints still have to be disabled!