What does GetKeyDown detect?
if (Input.GetKeyDown(KeyCode.Space))
- A key pressed on this frame
- A key held down on every frame
- A movement of the mouse cursor
- A gamepad being unplugged now
GetKeyDown is true only on the press frame.
Play Game Dev ▸
if (Input.GetKeyDown(KeyCode.Space))