hi!
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_up
and button_down
to a script.
Script:
var down_pressed = false
var ev = InputEventAction.new()
func _process(delta):
if down_pressed == true:
print("down_pressed")
ev.action = "ui_down"
ev.pressed = true
Input.parse_input_event(ev)
func _on_BtDown_button_down():
down_pressed = true
func _on_BtDown_button_up():
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.
It prints down_pressed
as long I press the key.