hi I'm trying to create a flappy bird sim with my own code and Im trying to make it so you cant hold down the space button and fly infinitely high.

private bool spacePressed;

private void
{
if (Input.GetKey(KeyCode.Space))
{
spacePressed = true;
}
}

@splitit you can use Input.GetKeyDown(KeyCode.Space) to only register when the key first gets pressed and not when it is being held. Remember that Input.GetKeyDown(KeyCode.Space) is only true for the frame that it detected that ‘Space’ was being pressed. Hope this helps.