Stopping Rigidbody 2D from rotating along any axis?

Is there any way to stop the 2D Rigidbody from rotating? i don’t need it to rotate in any axis so i was wondering if there was something i could do to completely disable the rotation - I’m getting this a lot in a game I’m making for college and its becoming a bit of a pain haha.

thanks for any help in advance. :smile:

Look at the Rigidbody2D page in the manual for a moment; there is a property that constrains z-axis rotation on 2D rigidbodies. 2D rigidbodies don’t naturally rotate along any other axis, so as long as you aren’t changing them in any script, you won’t have to worry about them. Just check the ‘Freeze Rotation - Z’ box to enable.

Alternatively, you could set the object’s transform.eulerAngles each frame in Update().

1 Like

oh, sorry! i tried using the freeze rotation feature before but i didn’t work, i didn’t realise that i had a script that countered it - for some reason i completely forgot that they would counter against each other - sorry for asking such a silly question and thank you for making me realise my mistake. :slight_smile: