- Home /
Unity 2d - Rigidbody rotation constraints?
I'm using 2d rigid body's in my game and although rotation isn't currently a problem, I could see it be for the players. Is there any way I can turn off all rotation for my 2d rigidbodys? Thanks! :D
Answer by bigdaddio · Dec 08, 2014 at 01:47 AM
There is a checkbox in the RigidBody2D Fixed Angle. This stops it from rotating. I left this here in case anyone else finds this.
Answer by Destran · Mar 23, 2014 at 05:57 PM
Yes there is!! :D
go to your rigidbody component --> constraints, and mark free rotation: x,y,z and it will stop your 2d thing from rotating.
Thanks for the advice, but that only works for 3d rigidbodys.. I was looking for a solution for 2d rigidbodys. Thanks for the help though! ;D
time to redeem myself
going off of
http://answers.unity3d.com/questions/13370/lock-rotation-of-object.html
you could try: ?
float lockPos = 0;
void Update()
{
transform.rotation = Quaternion.Euler(lockPos, lockPos, lockPos);
}
Works great with the new unity! Thank you very much.
Hmm.. Never thought of that.. Let me give it a try. I'll let you know how it turns out later! :)
Answer by koload · Oct 22, 2017 at 08:07 PM
I can only type numbers in my constrainsts box, any help what to do with it?
Your answer
Follow this Question
Related Questions
How can I make 2d sprites for Unity ? 1 Answer
In unity 2D c# how to rotate an object like geometry dash? 1 Answer
How can I keep the Ground ALIGNED with the red line in the image below 1 Answer
How can you make a 2D object move based on rotation, and rotate while moving? 1 Answer
How can I limit objects rotation to fixed range of 0 to 1? 0 being no rotation 1 full rotation? 1 Answer