Holding button script

Godot Version

4.2

Question

how can i make it so that i can hold a button and make it spam upgrades like how they do it in classic mobile games.

i figured i could just do a while loop but how would i make it so it takes like .5 seconds of holding and then it slowly upgrades faster the longer you hold on or while the button is pressed

Could you use a Timer node? Start it when pressed, stop when released?

1 Like

what would i do to make it progressively speed up

detect how long it’s been pressed down, then the value for that will determine the increment speed. the hold down time and value increment speed can be like key and value in dictionary

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.