Hello, I have the code below inside FixedUpdate
if (Input.GetKeyDown (KeyCode.D))
{
print ("D key pressed");
rigidbody.AddRelativeTorque(0,1,0);
}
but this does not work if ‘D’ is held down it runs once on each key press, and i’ve discovered that using a while loop freezes unity completely.
My question is how do I make the if statement run every frame if the ‘D’ key is held down?