Godot Version
4.2.1 (macOS)
Question
I have been struggling with this for a day and I think that there needs to be a simple way of doing this I missing here.
what I want to do
Create a effect that there ground is exploding when player steps on it, and play animation of it imploding inside again after he steps out of the tile, and repeat the cycle for the next tile.
how am I trying to do this:
I create a node in main tree that gets the signal when player changes coords on the tilemap. I instantiate the PackedScene with Spire2D and animation player on his position, start the explosion animation and put the reference to that Scene inside a dictionary. If there is already animation playing for the player I will pause() this animation and play it backwards, which looks exactly as I would like but…
the problem
I can’t clear the instance once it played. First thing I tried is to add a “call method track” and call a function that will remove the scene from the tree and queue_free it. But this will be called instantly not letting the animation play:
and add a flag for second animation play to actually remove the node on second play through.
It kinda works but it will call the function instantly. Not allowing the animation to finish playing.
I figured out maybe I should put the function in “call method track” at the beginning of the track as it is playing backwards (duh). But still the same issue.
not sure why it will call the method instantly when playing backwards.
I also tried to use the “animation_finished” signal on the animation player but it seems this is not emitting when I try to connect to it.