Error: "start: Timer was not added to the SceneTree. Either add it or set autostart to true."

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

I have an enemy with a timer attached to it. When the player attacks the enemy, it dies and gets destroyed, and that is when this error gets fired. Everything works fine and does as expected but this error is just a bit annoying. Here’s the code:

onready var idleTimer = $IdleTimer

func _on_DetectionArea_body_entered(body):
    if isActive == false:"Wakeup")
	    isActive = true

func _on_DetectionArea_body_exited(body):

func _on_IdleTimer_timeout():
    if  $DetectionArea.get_overlapping_areas():
	    isActive = false"Death")
	    yield(animSprite, "animation_finished")"Idle")

func _on_Hurtbox_area_entered(area):"Death")
    $Hurtbox.set_deferred("monitoring", false)
    $Hitbox.set_deferred("monitorable", false)
    yield(animSprite, "animation_finished")
:bust_in_silhouette: Reply From: jeudyx

This is a super weird one. Instead of calling .start(), set autostart = true

Just had the same issue.

I did this and it still dosen’t work, the Timer dosen’t timeout at all.

javrocks | 2023-06-28 00:30