Answers for "Setting value of transform.rotation in code, C#"
http://answers.unity.com/questions/604651/setting-value-of-transformrotation-in-code-c.html
The latest answers for the question "Setting value of transform.rotation in code, C#"Answer by LukeNukem44
http://answers.unity.com/answers/1522708/view.html
Rotate your character naturally:
transform.Rotate(x, y, z); // Local
transform.Rotate(x, y, z, Space.World); // Global
In case you want to rotate to an absolute angle:
transform.rotation = Quaternion.Euler(x ,y ,z);
There's a lot more to research in the manual.Wed, 27 Jun 2018 12:30:31 GMTLukeNukem44Answer by KellyThomas
http://answers.unity.com/answers/604657/view.html
A `Transfom` will store rotation as a [`Quaternion`][1], great for 3D maths but bad for human brains.
One trick you can do is to convert to euler angles (similar to the rotation as displayed in the Inspector):
Vector3 temp = transform.rotation.eulerAngles;
temp.x = 90.0f;
transform.rotation = Quaternion.Euler(temp);
[1]: http://docs.unity3d.com/Documentation/ScriptReference/Quaternion.htmlSat, 28 Dec 2013 17:25:34 GMTKellyThomas