Hello, I'm not sure if this is the correct category, but I'm currently working on a dialogue display UI that also includes dialogue choices and came across an issue.
Basically, I currently have a list of buttons stored in an array list variable and I'm using event.isactionpressed() to control which button is in focus.
if event.is_action_pressed('up') :
if focus_button_index == 0:
focus_button_index = choice_buttons.size() - 1
focus_button_index -= 1
The problem I'm currently having is that the up action is on the joystick, and as I lean the joystick forward, it be considered "pressed" and "released" multiple times in one forward lean. Is there something wrong with my joystick or am I just using this function incorrectly?
In case the description was unclear, I'll try to use angles to describe what the code would do:
With the joystick in the center (0 degrees): nothing happens.
I push it forward 10 degrees: nothing happens (still in joystick dead zone I assume)
I push it forward another 10 degrees (now at 20 degrees) without going back to the center: code enters if-statement
I push it forward another 10 degrees (now at 30 degrees) without going back to the center: code enters if-statement AGAIN