Hey, im comming from a VFX background and have just started playing around with unity.
But i just can’t get my head around the whole rotation thing.
If i in unity take a plane, set the rotation to 270 , 0 , 0 the object rotates as it should facing the Z axis.
However if i want to now tilt the object say, 90 degrees. I can’t do it.
Putting 270 , 90 , 0 will rotate the object around the Y axis, and putting 270 , 0 , 90 will do the exact same thing.
While in any 3D application putting 270 , 90 , 0 would eighter tilt it in its own or the world Z axis.
So in java i have set up the following:
Transform.Rotate(Vector3.down * Input.acceleration.y);
This slowly rotates the object around the Z axis as i want, but i want to set a absolute rotation and not slowly make it rotate around its own axis (ie Rotate 90 degrees, and stop)
So i tried the following
transform.rotation = Quaternion.Euler(Vector3.down * Input.acceleration.y)
That just introduced the problem described earlier.
What am i doing wrong?
did you try http://docs.unity3d.com/Documentation/ScriptReference/Transform-eulerAngles.html ? or http://docs.unity3d.com/Documentation/ScriptReference/Transform-localEulerAngles.html ? sfc
– sfc.itzhak