glitch-in-the-system/Scripts/destroy_after_animation.gd

12 lines
227 B
GDScript3
Raw Normal View History

2019-09-16 08:07:41 +02:00
extends AnimatedSprite
func _ready():
play("spawn")
connect("animation_finished", self, "on_animation_finished")
func on_animation_finished():
if(animation == "spawn"):
play("destroy")
else:
get_parent().queue_free()