|Attention||Topic was automatically imported from the old Question2Answer platform.|
|Asked By||Alex Night|
|Old Version||Published before Godot 3 was released.|
im tryng to make a dash function:
func backdash(): var can_dash = true var dash_time = 0 if Input.is_action_pressed("BackDash"): if on_ground == true: dash_time += 1 if direction == 1 and can_dash == true: if on_ground == true: can_dash = false velocity.x += -20 if direction == 0: if on_ground == true: velocity.x += 20
the problem is:
the backdash last as long as been pressing the button…
i want to make it so it last only a few seconds, like castlevania games
sorry for my english!
Edited to fix the code block.
eons | 2018-01-20 17:55