Rotating to a given rotation with a specific direction on a given axis
Hi! I have a rotated GameObject, when rotating the GameObject I used Quaternion.Lookrotation (the gameObject is parented and the parent is also rotated).
I want to bring back the localrotation of the GameObject to Identity BUT the catch is that I have a desired rotation direction on a given axis (global space, in my case X)(ex. clockways, counterclockways)
I am working on a platformer so, the rotation on X is always 0 and when turning the character I change it scale to -1.
Does anyone know an easy way of doing this?
Thanks in advance!
Answer by NeilM0 · May 06, 2016 at 02:51 PM
Take a look at the Quaternion.AngleAxis(angle, transform.left); command. It sounds like it might be what you're looking for.
Your answer
Follow this Question
Related Questions
what is the difference between transform.look at and quaternion.look rotation 0 Answers
Using quaternions to align game objects. 1 Answer
how can I change the interpolation type of animationclip's rotation property 1 Answer
3 Axis Camera Rotation 0 Answers
Help with creating rotational mapping 0 Answers