Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | dragonmantank |
I am following along with a tutorial, and as part of the general control loop it has this block to determine what direction we need to move based on the arrow keys:
var LEFT = Input.is_action_pressed("ui_left")
var RIGHT = Input.is_action_pressed("ui_right")
var UP = Input.is_action_pressed("ui_up")
var DOWN = Input.is_action_pressed("ui_down")
movedir.x = -int(LEFT) + int(RIGHT)
movedir.y = -int(UP) + int(DOWN)
If I hold down one of the buttons, say the right arrow, this works for about a full second of a press before it seems to stop registering the keypress, and every loop it detects then drops the keypress. I added the following to check what movedir
is being set to:
print(movedir)
I get the following output in my console
(1, 0) // About a full second of a bunch of these, then the looping
(0, 0)
(1, 0)
(0, 0)
(1, 0)
(0, 0)
(1, 0)
(0, 0)
(1, 0)
(0, 0)
(1, 0)
It seems like the keypress is just stopping being registered, and then immediately picked back up.
I’m running Fedora 28 with GNOME Classic, and have tried 3.0.4.stable.fedora and 3.0.6.stable directly from the website, and both versions cause the stuttering.