i am making a hockey game, when you hit the puck it goes forward, after a timer it stops but doesnt work a 2nd time

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By godoh

example of whats happening

var puck_timer = $Timer

func example1()
puck_timer.set_wait_time(2)
puck_timer.start()
Vector2(0, 1)

func on_Timer_timeout()
Vector2(0, 1)
puck_timer.stop
example1()

#timer doesnt work when i call the func that starts the timer

I looked over the code and didn’t find any issues. you may need to show the original code, there might be a mistake in it, if I’m not missing anything.

Asthmar | 2021-06-11 07:56

:bust_in_silhouette: Reply From: theMX89

if (puck hits timer):
$puck_timer.play

i would do it like this