From e292217f362b2773e3bcd32b448e36a6cdef2dd2 Mon Sep 17 00:00:00 2001 From: "Silc Lizard (Tokage) Renew" <61938263+TokageItLab@users.noreply.github.com> Date: Sun, 9 Nov 2025 14:34:14 +0900 Subject: [PATCH] Move the line of calling animation_finished signal to ensure stopping --- scene/animation/animation_player.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index eea2ed3a948..ce374b255b0 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -331,14 +331,13 @@ void AnimationPlayer::_blend_capture(double p_delta) { } void AnimationPlayer::_blend_post_process() { - if (!finished_anim.is_empty()) { - emit_signal(SceneStringName(animation_finished), finished_anim); - } - if (end_reached) { // If the method track changes current animation, the animation is not finished. if (tmp_from == playback.current.from->animation->get_instance_id()) { if (playback_queue.size()) { + if (!finished_anim.is_empty()) { + emit_signal(SceneStringName(animation_finished), finished_anim); + } String old = playback.assigned; play(playback_queue.front()->get()); String new_name = playback.assigned; @@ -351,6 +350,9 @@ void AnimationPlayer::_blend_post_process() { playing = false; _set_process(false); if (end_notify) { + if (!finished_anim.is_empty()) { + emit_signal(SceneStringName(animation_finished), finished_anim); + } emit_signal(SNAME("current_animation_changed"), ""); if (movie_quit_on_finish && OS::get_singleton()->has_feature("movie")) { print_line(vformat("Movie Maker mode is enabled. Quitting on animation finish as requested by: %s", get_path()));