|
What is the most efficient way of setting a rotation of a single axis of a GameObject without changing the other values?
(comments are locked)
|
|
what jaap did can be done by transform.rotate and i think it's not what you want and you want to set the value directly. you can use his code but remove the "rot*" and then the code will be
if you want to add some value to any of the x,y,z values simply use
this will add 10 to Z value
(comments are locked)
|
|
I think this is what you're looking for :
(comments are locked)
|
|
Don't know what you exactly want but maybe this is it: this can be done easily by transform.rotate
Dec 28 '09 at 06:00 PM
Ashkan_gc
(comments are locked)
|
|
The rotations are stored as quaternions, so you can store the appropriate quaternion and set transform.rotation to that. Perhaps an explanation of what you are trying to accomplish would help. If you go into "Debug mode" and watch the rotation values change, you can see how just changing one axis's value isn't really more efficient. It only looks that way in "Normal mode".
(comments are locked)
|

related: http://answers.unity3d.com/questions/8599/how-do-i-rotate-and-object-around-its-center-in-sc.html