Question by
ShinyTaco · Jan 16, 2018 at 09:40 PM ·
rotationquaternionaxis
How to Rotate Quaternion 180 Relative to GameObject?
Hi everybody,
I'm using:
transform.rotation = Quaternion.Euler (transform.rotation.eulerAngles.y, 180,transform.rotation.eulerAngles.z);
I want to rotate my gameObject 180 degrees relative to the direction it's facing.
If my Y axis is 0 and I rotate I want to rotate to 180.
If my Y axis is facing 90 and I rotate 180, I want to face 270.
This works fine, but it's always rotates to 180 in World Space.
I'd like it to rotate relative to the direction the player is facing.
Any help is really appreciated.
Thanks!
Comment
Your answer
Follow this Question
Related Questions
Using Local Angles to target enemy object 0 Answers
3 Axis Camera Rotation 0 Answers
How can I work with the opposite angle? 0 Answers