- Home /
Question by
uanmanarmy · Mar 28, 2015 at 09:41 PM ·
rotationvector3unity5quaternion
[Unity5]Quaternion.Eurler adds me 90Degrees on X
So Hi.
This line of code.
door.transform.rotation = Quaternion.Euler( 0, 0, 0);
Will give my object the following vector (90, 0, 0);
The next line of code
door.transform.rotation = Quaternion.Euler( -90, 0, 0);
Will give me the Vector3.zero.
My question is, if Quaternion is added by default a 90 degrees to the x axis, because if I go with Quaternion.Idenity it will add too. Or is this a bug of Unity5
Comment
Answer by DuneWalker · Mar 29, 2015 at 02:56 AM
I suspect your GameObject is already rotated 90 degrees by a parent object. The rotation member is likely in global space. Try using door.transform.Rotate(90,0,0) if you want to rotate it locally.
Your answer
Follow this Question
Related Questions
Unity Rotate Raycast on Quaternion 1 Answer
Rotating wrong 0 Answers
how to convert the angle to roatation? 1 Answer
Rotating direction vectors 1 Answer
Quaternion amount/value of rotation? 2 Answers