Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Tiez |
i was trying to make my player to dash in a short amount of time. But it dashed once and didnt dash again at all. And there was no issue with my scripting. And i think timer nodes might doesnt work well inside signals. or there is a problem with my scriipting?
And i was trying to troubleshoot, then what i found is that cool_down node doesnt start.
Here is my script:
dash_av = 1
if Input.is_action_just_pressed(“player_1dash”) and Input.is_action_pressed(“ui_right”):
dash()
if Input.is_action_just_pressed(“player_1dash”) and Input.is_action_pressed(“ui_left”):
dash()
func dash():
$dash_time.start()
maxspeed = 1500
motion.y += gravity * 2
acc = 2000
dash_av = 0
func _on_dash_time_timeout():
maxspeed = 500
acc = 100
$dash_cooldown.start()
func _on_dash_cooldown_timeout():
dash_av = 1