Hinge joint limits not working properly

I am trying to make a door model rotate around the Y axis within the limits of -90, 90 or any simiar limits pretty much, but after tweaking around i havent made my doors a single time manage to not violate their limits.

For the picture only the spring is disabled for now.

This happens under the following circumstances :

  • Spring is enabled and target position is set to 0 (to make the door automatically recover even if the player walks away)
  • The player moves towards the door in the direction of the door that fits its max angle ( So if the door is 90 in “x” direction and the player moves towards said “x” direction the door is facing, then the error happens )
  • The player uses character controller.

To get to the actual error at this point, when the door is then moved based on the above it completely flips and bounces all over the place till the player moves away before the spring manages to recover the angle, but one simple debug script shows that the angle shown is something that goes way above the limit (150 160 and growing instead of obeying the enabled limits and simply not moving past that).

I wanna thank anyone who took the time to read this and if you are able to help me then thanks even more.

What worked for me was to put a “Fixed Joint” on my doorFrame and a “Hinge Joint” on my door. The “Connected Body” of the “Hinge Joint”(door) points to my doorFrame and I checked IsKinematic on the Rigidbody of my doorFrame.

As soon as I checked IsKinematic on the doorFrame it was properly bound by its limits