Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | cardoso | |
Old Version | Published before Godot 3 was released. |
I’m trying to have a character do a dash move by pressing twice in directional pad (so I guess a “press, release, press” logic), but cannot seem to have the logic right.
I have some code like this:
func _process(delta):
var move_right = Input.is_action_pressed("move_right")
// here I tried some logic to detect player pressed twice in the directional pad
(...)
if(dash):
// do dash move
elif(move_right):
player.set_scale( Vector2(1, 1) )
player.move_local_x( player_speed * delta )
I tried using is_echo()
in the _input()
Also using is_action_released()
Also tried storing the previous action press (or previous action release) in a variable.
Just can’t seem to get it right.
It either did not work or the character would just dash by holding directional pad right.