I have tried different constraint types (like hinge) but they don’t seem to solve the problem and they also don’t move as well. I have also tried using rotation limits on the armature but these don’t seem to stop it??
Well, first question: Why have you used all these objects with Rigid Body Physics to move the bones? They only seem to confuse matters when you can just rotate the bones to animate the mesh.
Your arm and leg bone chains are not connected, so they will not move as you intended. I would get rid of all the shapes used to move the bones and just move the bones, having connected the chains, unconnected chains is what was causing the “twist” issues.
Just rotate any of the bones to animate it, I have added a “Root” bone between the feet, always a good idea and ideally you should also have bones between the spine and limbs, shoulders and hips, so these areas of the mesh deform better. Search the Rigify rig for a good example of a character rig, others are out there, also and look up Nathan Vegdahl’s “Humane Rigging” series of tutorials for a complete guide to character rigging, others are also available, but these were my stating point.
Here he is posed using the bones only after I connected them:
Because he is a ragdoll. I don’t want to animate him manually, I want to throw him down some stairs. I appreciate what you’ve done but that’s not what I am trying to achieve.
The stairs don’t matter for now. The first file has a couple of boxes just to test the movement. If the bones are connected this stops them from accurately following the physics boxes. I have tried applying limit rotation constraints to the boxes as well but the arms still twist??
I tried Limit Rot’s on the bones as well as the boxes, they are all being ignored!! So I think I cannot find a solution just now, I will do some research for you.
Cheers, Clock.
EDIT:
Locking the X-Rot Lock on one of the boxes helps, but does not entirely stop it rotating:
One thing I noticed is that the local axes of the Rigid Body Objects and the bones they are parented to do not match, in that the axis along the bone is always Y and the axis along the highlighted RBO is X, this may be some of the problem and turning the objects around so the axes match the bones’ axes might help since the Child Of is trying to match X to X, Y to Y, Z to Z and this is not the case with your RBOs:
It might be worth trying to rotate the RBO so its axes match the bone (you cannot change the bone axes), then going to Edit mode and rotating the vertices so they are where they should be in this rotated state and see if this has any effect, don’t apply the rotation by the way.
Sorry I can’t offer any more help!
Cheers, Clock.
EDIT:
Second thought, have you tried using Copy Location and Copy Rotation constraints on the bones instead of a Child Of, you will have to move the origin of the RBO to the head of the bone, that might help also.
Thanks. I tried the copy location and rotation instead of Child Of and you are right, the rotation does not match up , the arm immediately goes to a 90 degree angle. I will try and fix this and give it a try. I also tried the rotation lock on the physics box, constraint AND bone and this seems to work a bit better. I’m not sure this is the best way of doing it but I will ‘roll’ with it for now. Thanks for all your help.
Rotate the RBO 90 degrees about Z to line up the axes, to stop this (for the one I mentioned previously, others will require different rotations maybe). I am at my flying club today, but can take another look later.