0 votes

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):
    idleTimer.stop()
    if isActive == false:
        animSprite.play("Wakeup")
        yield(animSprite,"animation_finished")
        animSprite.play("Active")
        isActive = true


func _on_DetectionArea_body_exited(body):
    idleTimer.start()


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


func _on_Hurtbox_area_entered(area):
    animSprite.play("Death")
    $Hurtbox.set_deferred("monitoring", false)
    $Hitbox.set_deferred("monitorable", false)
    yield(animSprite, "animation_finished")
    queue_free()
Godot version 3.5.1 stable
in Engine by (81 points)

1 Answer

0 votes

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

https://github.com/godotengine/godot/issues/33929

Just had the same issue.

by (34 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to w[email protected] with your username.