Hello,
I have not found an answer to this and related postings, so I would really appreciate a clear answer (as I’m sure others will too).
I am using CharacterJoints with a ragdoll, and want to implement a controller to bring the ragdoll ‘to life’, i.e. moving the joints about.
I would like to know:
How can I obtain the current angle of rotation of the joint at runtime? Can someone clarify exactly how this works in unity with a CharacterJoint, bearing in mind that it has the potential to rotate around 3 axes?
e.g. why is there not a joint.angle1/angle2/angle3 method or property?
I’m sure there is a sensible answer, and I admit I am slightly confused between local/world coordinates etc. If there is no direct way, what exactly is the way to work it out?
FYI, my controller for each joint will take 1, 2 or 3 axes (since I think I am aiming for twist, swing1, swing2 axes) and output a value from 0…1 for each, which represents the desired angle of the joint in that axis.
My goal is therefore to take this 0…1 value and first map it to a desired angle (in degrees) from the appropriate minimum and maximum range (exactly how to obtain this, versus just using the adjusted parameters in the Inspector, I am also not clear on). To compute the torques required to move the joint to the desiredAngle, I need to know what the current angle is (for each axis), and it is this which I cannot do.
Thank you very much indeed for any suggestions.
Greg