0 votes

I’m making a game where it is important to press the same button multiple times. But in gdscript I don’t know how to check for this.

Godot version 3.2.2
in Engine by (34 points)

2 Answers

0 votes

You can use this method inside _process(delta):

if Input.is_action_just_pressed("ui_up"):
    # do something


by (805 points)
0 votes

You should have a variable that keeps track of how many times the button has been pressed. Increase this variable every time the button is pressed. You can tell when the button is pressed with a signal.

Edit: wait you were looking for a key and not a button node. Okay in that case the concept is the same, just use an input() function

by (7,954 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.