- Home /
Question by
chillypacman · Feb 27, 2013 at 10:41 AM ·
rotationeditorquaternion
Set rotation in script like editor?
In the editor I can set the rotation of something using three seperate components, how can I use the same values in these components in the script? I tried Quaternion.LookRotation but it didn'twork...
Comment
Best Answer
Answer by Mikilo · Feb 27, 2013 at 11:24 AM
Hi!
Use:
transform.eulerAngles = new Vector(x, y ,z); // To set
Debug.Log(transform.eulerAngles.x); // To get
Notice these values are in global axis.
transform.localEulerAngles
are the same except in local space.
Your answer
Follow this Question
Related Questions
Rotation with respect to world instead of the object itself using Quaternion in unity 0 Answers
Rotation to go from one direction to another? 0 Answers
A little help with this camera script please? 3 Answers
Why is my object's local x rotation not going past 90 degrees? 1 Answer
A Problem With Quaternion.Slerp 2 Answers