- Home /
Problem with Rotate() conditions
Hi, so I wanted to make a car
if (Input.GetKey(KeyCode.D) && tire1.transform.rotation.z > 65) { tire1.transform.Rotate(0, 0, -turnValue); tire2.transform.Rotate(0, 0, -turnValue); }
both Tires have a rotation of 90 on the z Axis but when i press "D" nothing happens Thanks for all answers
transform.rotation is a Quaternion hence tire1.transform.rotation.z is not a angle at all. What you're looking for is transform.eulerAngles or transform.localEulerAngles (both in degrees)
Your answer
Follow this Question
Related Questions
Rotate an object (gun) around another (player) to always face the mouse position. 0 Answers
Unity 3D Terrain Tree Rotation Bug 0 Answers
How do I rotate player's camera to peak around objects. (first person shooter leaning) 1 Answer
How to rotate an object to "sit" on a sphere 1 Answer
The vision of a camera (displayed as a 3D Cone) needs to rotate towards the player 1 Answer