Why is this code in the script not stopping the rotation of the Gameobject?
if (Input.GetKey(KeyCode.A) && (this.transform.rotation.x<=18f))
{
transform.Rotate(Time.deltaTime*15, 0, 0);
}
else
if (Input.GetKey(KeyCode.Q) && (this.transform.rotation.x >= -18f))
{
transform.Rotate(-Time.deltaTime*15,0,0);
}
both cases don't work.
1.png
(202.9 kB)
Comment
Your answer
Follow this Question
Related Questions
Endlessly Spinning Drone 1 Answer
Flip 3D Character Rotation 180 on Y axis 1 Answer
Problems With .rotate behavior 1 Answer
transform.Rotate having no effect 0 Answers
Applying AddForce() while rotating player gameobject. 0 Answers