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
sorry for my english!
: