How to check if key is still being pressed?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By snaxxtrickster

I’m working on a little platformer, which of course has a button you can press to jump. In most platformers, pressing the jump button quickly makes your character do a short little jump, while pressing and holding the jump button makes the jump higher.

I wanna add that function since pressing the jump button makes the player jump as high as I set it. But I wanna also make it so that the game checks if the player is still pressing the jump button.

so how?

:bust_in_silhouette: Reply From: whiteshampoo

You can use Input.is_action_just_pressed("key") to see if it was just pressed,
and Input.is_action_pressed("key") to see if it is still pressed.

1 Like