Emit a signal after animation completes #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey Alex,
I wanted to be able to run some animations during cutscene dialogue and couldn't find a way to limit an action to a single repetition. This was my best solution, though it's not perfect. With this code I'm able to play an animation, then await the new signal to know it's done.
I don't like using flags that much but I needed to do it this way to ensure I'm grabbing a sprite with the used animation (in the case of multiple sprites) to not brake functionality for people using the add-on that way. Make sure it's flagged to avoid sending the signal multiple times.
Also to note that I use the add-on purely in code (no scene tree entry) so the signal cannot be linked with a node in the scene-tree to achieve this.
Open to your thoughts.