My use case is this:
I have created a Node with a RigidBody, which I have rotated 90 degrees round z-axis.
Then I have created a hinge constraint on it, connecting it to another RigidBody.
I want to rotate the body round x-axis. I have set the axis on the constraint like this:
constraint.SetAxis(Vector3.UnitY);
constraint.SetOtherAxis(-Vector3.UnitX);
The rotation works. But the thing I’m stuck on is setting the limit on the constraint.
When I set low and high limit to 0 the body rotates automatically 90 degrees!?
But if I set the limit to 90, the body doesn’t rotate.
If I don’t rotate the body (and rotate it round y-axis instead), and having the limit set to 0, it doesn’t rotate automatically.
It makes me believe that the angle starting values are different when rotating round y-axis and round x-axis?
I would also like to know how many degrees the body has rotated round x-axis, in able to set it on the limit (so that the body is locked in current angle). But I can’t get this to work, probably because of my first problem (the 90 degrees offset).