When I'm rotating my spaceship with this script, it keeps rotating when I don't want it to.
var turnSpeed = 15.0;
function Update () {
transform.Rotate(Vector3.forward, Input.GetAxis("Horizontal") * turnSpeed, Space.Self);
transform.Rotate(Vector3.right, Input.GetAxis("Vertical") * turnSpeed, Space.Self);
}
I want the spaceship to stop turning right when I don't press "d". Is there anything that might help in my script?