- Home /
change just z axis angle
i want to reset just the z axis to 0 (angle) how can i do it?
this is the code that i tried:
transform.rotation.SetEulerAngles(transform.rotation.eulerAngles.x,transform.rotation.eulerAngles.y,0);
Comment
Best Answer
Answer by MousePods · Mar 13, 2014 at 04:36 PM
Try this:
this.transform.eulerAngles = new Vector3(this.transform.eulerAngles.x, this.transform.eulerAngles.y, 0);
Your answer
Follow this Question
Related Questions
Rotating Object on its Local World Axis 4 Answers
C# Make an object rotate along axis its moving on 0 Answers
Object facing the wrong way? 1 Answer
Rotation Object Follow Help 2 Answers
rotate axis of movement 0 Answers