Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Zalinho |
Im working on a basic timer and have no clue as to why the code is not working. This same code I have used on another scene and works fine yet on the current scene i am trying to program, the timeout never occurs. I made some tester code to figure out why but i still cant see the issue.
var on = true
func _process(delta):
if on == true:
$Timer.start()
if($Timer.time_left) > 0:
print(str($Timer.time_left))
else:
print("OFF")
else:
print("TIMER WORKED")
with the timeout code correctly connected
func _on_timer_timeout():
print("TIMING OUT")
on = false
I dont know if im being stupid or something but i just cant see whats wrong with the code. The output is stuck on 1 so the time left is always 1 but i don’t see why. Nothing else happens and the timeout never occurs. This same code complicated with more code works in another scene but here it doesn’t which is why im struggling.
the timer process mode is set to idle, autostart off and oneshot off.