HingeJoint and setting angle.

Probably a silly question but here it goes.

I am using HingeJoint to open and close my door and once close I want to set the angle to the targetPosition. For example, I am seeing that the door will get close to the targetPosition but may not always get to it exactly. I would like to ensure that by setting it.

From what I have seen, hingeJoint.angle is read only so I was wondering what the accessor for setting this would be?

Regards,

– Clint

There is no accessor for setting it directly. You could simply set the rotation of the transform manually though.

Another approach would be increasing the springForce or setting min and max angles of the hinge.

Can you please look into HingeJoint.angle?

The fact that it changes whenever the connected bodies rotate in world space - even if the hingejoint retains its position - makes it almost a completely useless variable.

Thank you.

I’ve seven Hinged Joints linked together and when I try to rotate them together my Objekts jitters, even when all Hinge Joints reached their target position. When I move every Joint by itself, the Objekt does not jitter, but in this way the movement looks not “real”.

Can you help me? Is there a way to set the Hinge Joints to fixed value?