Lock One Axis of Rotation

Hello all,
How would I lock the rotation of an object but in only one axis, please give an example of how to do this.

Thanks in advanced! :slight_smile:

if you’re using a rigidbody there are constraints which you can set in the inspector

But that just stops the rigid body from changing anything, not lock the rotation entirely. Anyway I have found a solution already