Godot Version
4.2.1
Question
I’m trying to get an AnimatedSprite2D to queue_free when it has finished its animation, but I am clearly missing something.
func _ready():
var sprite = AnimatedSprite2D.new()
sprite.sprite_frames = load(“res://spriteframes.tres”)
sprite.position = Vector2(100,100)
sprite.play()
sprite.animation_finished.connect(queue_free.bind(sprite))
self.add_child(sprite)
The animation loads and plays but doesn’t free
Thanks