Godot Version
4.5
Question
Hi, I have a character movement with keyboard. Right now I have:
- When press right : go forward
- When press left : go back
What I want is when both keys are down player will go where the key pressed last.
-
When holding left key then press(and hold) right key : go forward
-
When holding right key then press left key : go back
Currently I have this code but it only goes for one way only.
if Input.is_action_pressed("right") and Input.is_action_pressed("left"):
print("BACK")
elif Input.is_action_pressed("right"):
print("FORWARD")
elif Input.is_action_pressed("left"):
print("BACK")
Thank you.