Hinge joint moving out of place when collision happens

I’ve setup a hinge joint and even included limits on its rotation but it ignores the limits and when it collides with another object, its axis springs out of location.
I really want it to just stop rotating when collision happens (and of course transfer the rotation energy to the object it collided with)
Is there a way to fix this?

1 Like

If you have it set up correctly then it’s probably a physics accuracy problem. You need to increase the solver iteration count and or decrease the FixedUpdate timestep.

1 Like

It looks like its a solver iteration count issue. Thanks for pointing me to that. It does get a little better when I increase that number however I’m not sure how it will affect the overall performance of the game since I’m using physics everywhere. Maybe I should write a script that helps it avoid going past the collider no matter what

If you use the Configurable Joint instead you can use the Projection settings. This tries to snap things back to the limits if they are exceeded. Just how well it works for your particular case though I don’t know, you would have to try it.

Just another suggestion!

Also you can change the solver iterations per rigidbody, not just globally.

My fix was to disable “Auto Configure Connected Anchor”