Recently tried to make on screen controls but I ran into an issue
I had four touch screen button with name
BtUp, BtDown, BtRight and BtLeft. And I had connected their
button_down to a script.
var down_pressed = false
var ev = InputEventAction.new()
if down_pressed == true:
ev.action = "ui_down"
ev.pressed = true
down_pressed = true
down_pressed = false
I had done the same for all the buttons but whenever I press and release any button then It only moves that way but don't stop.
down_pressed as long I press the key.