Topic was automatically imported from the old Question2Answer platform.
Asked By
Alex Night
Old Version
Published before Godot 3 was released.
Hello guys!
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
Add a cooldown Timer to enable a variable that allows dashing, and start the timer when blocking the dash, I say a timer and not check dash animation because you may want to prevent instant continuous dash, but using an animation track to toggle a variable is fine too
i forgot about the timers nodes!
thanks im gonna try this!