- Home /
rotate object with degrees
I want to rotate an object 90 degrees because doing Mathf.PI / 2 me it always turns 180 degrees?
ogg.transform.rotation.z = Mathf.PI / 2;
Comment
but if I want to rotate the object with radians as I do? That is, I wanted to create a function to rotate through my radiant
Answer by robertbu · Aug 02, 2014 at 03:02 PM
'transform.rotation' is a Quternion. The individual components (x,y,z,w) are not angles in any form (radians or degrees). If you want a relative rotation, you can do:
transform.Rotate(0,0,90);
If you want an absolute rotation, you can do:
transform.eulerAngles = Vector3(0,0,90);