- Home /
Frreze Rotation and poSITION PROBLEM HELP!!
when i check the square to freeze the position and roation of my rigidbody everything is fine.....but when i script it
rigidbody.constraints = RigidbodyConstraints.FreezeRotationX;
every other freeze suqare that i checked becomme uncheck...only the X position is checked...and i need to script it...if i want to change it during the game!!!! if i do that
rigidbody.constraints = RigidbodyConstraints.FreezeRotationX;
rigidbody.constraints = RigidbodyConstraints.FreezeRotationY;
rigidbody.constraints = RigidbodyConstraints.FreezeRotationZ;
only the first one will be freze and the other one wont freeze....so WTF!!
Answer by Seth-Bergman · Jul 25, 2012 at 12:53 PM
rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY;
to combine multiple constraints, judging from the script reference..
Answer by Piflik · Jul 25, 2012 at 12:45 PM
Why not rigidbody.freezeRotation = true;?
You need to set the rotation constraints of the rigidbody just as Seth described above.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Camera rotation around player while following. 6 Answers
Problem with transform.Rotate 1 Answer
Blue screen in Unity? 0 Answers
Aircraft wing position 0 Answers