Godot Version
Godot 4.2.2
Question
Hi, all,
Newbie here,
Following some videos on YouTube, which states everything should be its own scene, I’m making a game with a Main Scene, in the scene, I’ll have the player character and some enemy characters (all are separate scenes).
For example I have an enemy called Goblin (a scene), which has 3 AnimatedSprited2D animations: “idle”, “attack” and “die”.
At the end of its death animation, I would like to spawn a treasure chest, since I’d like to do some RNG operations to get random items from it. Different content will have different appearance, thus I made it into a scene.
Now, my problem is, I want to spawn the chest ONLY WHEN the Goblin finishes its death animation. While I can control the Goblin scene to play its death animation, I won’t know when the Goblin has finished its animation. I know there is an on???_animation_finished() signal in the AnimateSprite2D, but I couldn’t link that signal to my Main Scene to tell me when the Goblin is completely dead.
I tried to ignore the sequences, and spawn the chest as soon as the Goblin is dead in my game logic, but that just don’t look right…
So is it possible to detect when a scene finished its animation, or is my design fundamentally flawed? Like, I shouldn’t make everything into its own scene?
Please advice and thanks in advance.