I have the following code in a node and have a timer node named "Monster_Timer" as its child node
func _on_Monster_Timer_timeout():
print(timer)
if timer == 1:
timer = 0
timer += $Monster_Timer.wait_time
the wait time is 0.05
When I run the code, the number keeps rising even when it reaches 1.
What's wrong with the code??
================================
I solved the issue
First, the code works fine when the wait time is 0.5
So I changed the code into this:
if int(timer) == 1:
timer = 0
I guess when the wait time gets small, something goes off