Locking Rotation of a rigidbody

I have an object that I need to restrict the rotation on, but only along a certain axis. The axis needs to be relative to the objects parent object and this object is also attached to the parent with a spring.

What is the best way to do this? Most of the things I’ve tried are not physics friendly and end up ripping the springs apart.

Try using a ConfigurableJoint for this. Make sure you uncheck “configured in world space” if you want it restricted in local space.