About Hinge Joint Angle, Limit, and Motor.

I’m using multiple Hinge Joint to make a crane, and I find that the hingejoint.angle is not the same angle using in hingejoint.limits. The angle will change if I rotate parent hingejoint using motor.

And in motor, I find that setting targetvelocity to zero will not stop hinge joint rotating by gravity. I have to set a small value to it, like 3, so the hingejoint can fully stop.

I’m not sure whether it is a bug or I’m mistakenly using hingejoint. Anyone have some idea? Thanks.

1 Like

Anyone?
I also do some test, that the hingejoint.angle is not equal to rotation angles even when I don’t rotate the joint.
So how is the hingejoint.angle calculate? And how can I get a real angle of current hingejoint? Great thanks!

I’m with the same problem. It’s very strange that hingejoint.angle changes when the body rotates.

Yep. Can someone from Unity please look into this? It seems like HingeJoint.angle is almost completely useless as is.

i too, help pls

i solved the problem using 360 - transform.localEulerAngles.z

1 Like

This got me on the right track!
I used something like:

float xx = transform.localEulerAngles.z<180?transform.localEulerAngles.z: transform.localEulerAngles.z-360;

value = (xx) / (joint.limits.max - joint.limits.min)*2;