- Home /
Fixing a joint-attached object in place?
Ok, i have a ragdoll, made of lots of little rigidbodies. And i'm trying to get a character to pick it up by grabbing one of those bodies.
The character (a dog) has a little manipulator object inside it's mouth, with a fixedJoint, and a rigidbody which is set to kinematic and its constraints are set to FreezeAll
The fixedJoint is connected to the target rigidbody on the ragdoll that i want to grab it by, and that target also has it's constraints set to FreezeAll. The target is NOT set to kinematic, because if i do that, the joint is simply ignored, and the target acts like it's not connected, and is thus left lying on the floor.
This system is working almost perfectly, the ragdoll stays in the position i want, moving and dangling realistically like i desire. However it does not rotate with the dog. The ragdoll rotates based on its own momentum, which means it mostly doesn't at all, but spins back and forth slightly, and holds roughly the same world rotation instead of being local to the dog. This is not desireable.
If i remove the rotation constraints on the target rigidbody, the whole ragdoll spazzes out and flies apart. Apparently constraining the rotation is necessary to make this stable.
I've tried adding the ragdoll as a child to the dog's mouth when picked up. Surprisingly, this changes nothing at all. Literally nothing. Everything works exactly as before, and the dog and the ragdoll act like they're not at all in the same hierarchy. (it is definitely happening though)
What i want is for the targeted piece to behave as if it is clenched in a dog's jaws. That is, it does not move or rotate at all relative to the mouth, while the rest of the ragdoll dangles off it as appropriate. So far only the movement is working, how do i make the rotation work?