Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimationPlayer not emiting animation_finished for queued animations #27509

Open
Tracked by #73537
txigreman opened this issue Mar 29, 2019 · 6 comments
Open
Tracked by #73537

AnimationPlayer not emiting animation_finished for queued animations #27509

txigreman opened this issue Mar 29, 2019 · 6 comments

Comments

@txigreman
Copy link

Godot version:
3.1.stable.official

OS/device including version:
Windows 10

Issue description:
When several animations are queued in an AnimationPlayer, signal animation_finished is not emited when changing between animations, but animation_started is.

image

Both signals (animation_started an animation_finished) provides the animation name, but behave different as the first one is called for each individual animation, but the second doesn't. I think they both should be called for each animation, and maybe include two new signal to indicate the global/queue start and end.

Note: Tween class has tween_started and tween_completed signals, and emits them for each individual "animation".

Minimal reproduction project:
Test.zip

@akien-mga
Copy link
Member

That's by design, AnimationPlayer emits animation_finished when it finishes playing animations. If it chains to another animation, it emits animation_changed instead.

@ghost
Copy link

ghost commented Apr 9, 2019

There might be a worthwhile discussion if any future refactoring is to be for the AnimationPlayer. Some of the naming and behavior of things are not exactly intuitive, and perhaps missing.

Like play/stop also doubling as resume/pause depending on how you flag the stop.

Finished also implies the animation has completed a cycle, regardless, so I don't know it just wouldn't fire both changed and finished. I think it also doesn't fire when dealing with loops, so you have to resort to call function keyframes to tie into catching things at the end of looping animations.

@txigreman
Copy link
Author

The current behaviour, in my opinion, is not consistent and misleading: animation_started is called for each animation, but animation_finished is only call at the end of the queue. I think they both should behave in the same way. Also the documentation is not very specific indicating when the signals are emitted.

On top of this I saw on this Godot 3.2 preliminar changelog that Tween now has a new signal tween_all_completed. I understand it's a different node, but in my opinion we should try to make this details consistent across all the platform. For Tween is completed, and it's called for each tween, but for AnimationPlayer is finished, and is only called at the end of the queue...

@golddotasksquestions
Copy link

@txigreman These are good and valide points, you might want to mention them here: #16863

There definitely should also be consistency with on_finished signal when loop is turned on (#34608).
The more I think about it, the more I would find it consistent to have on_finished emitted at the end of the animation, no matter what (with or without active loop or queue). And then have a new signal on_queue_finished emitted at the end of the queue.

@ghost
Copy link

ghost commented Apr 18, 2020

For anyone who may come to work on this, it might also be worth watching for this bug as well: #22210

@KoBeWi
Copy link
Member

KoBeWi commented Jul 22, 2021

Well, unless animation_started plays from AnimationTree, it can be removed. animation_changed covers it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants