Hinge Joint with no displacement, strict rotation limits

Hi all,

I need to create a kind of hinge joint that is

  • using springiness( for rotation),
  • allows 0 displacement relative to it’s anchor
  • has strict axis rotation limits (the joint’s rotation must not exceed these limits at any given time).

I tried hinge joint, but when dragging on of the connected rigidbodies a displacement appears relative to the anchor.

I tried configurable joint, set it up as a hinge joint with springiness,set the projection mode to position and using a projectionDistance of 0.05 the displacement problem disappears, but I can’t limit the rotation of the joint for a given angle (ex 45 degrees), when forced to a wall I can make it do a 360 rotation.

How can I make this strange joint? It seems to me that none of the joint available in Unity is capable of this.

Thanks in advance!

You’ll want to look at the Configurable Joint. There’s a pretty decent tutorial at 3D Buzz, along with tutorials for the other joint types: