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

Fix AnimatedSprite doesn't emit animation_finished when changing playback direction #61085

Merged
merged 1 commit into from
May 16, 2022

Conversation

timothyqiu
Copy link
Member

Fixes #61078

The is_over here is preventing the signal from being triggered.

if (!is_over) {
is_over = true;
emit_signal(SceneStringNames::get_singleton()->animation_finished);
}

It will be reset to false in _reset_timeout(). When calling play() in animation_finished, set_playing() will be called, but it will return immediately as the playing state is not changed. So the is_over is still true.

void AnimatedSprite2D::set_playing(bool p_playing) {
if (playing == p_playing) {
return;
}
playing = p_playing;
_reset_timeout();
set_process_internal(playing);
}

I think it makes sense to always reset is_over to false in play().

@timothyqiu timothyqiu added bug cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:animation labels May 16, 2022
@timothyqiu timothyqiu added this to the 4.0 milestone May 16, 2022
@timothyqiu timothyqiu requested a review from a team as a code owner May 16, 2022 13:12
@akien-mga akien-mga merged commit fda397b into godotengine:master May 16, 2022
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the as-over branch May 16, 2022 13:59
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AnimatedSprite doesn't emit animation_finished when changing playback direction
2 participants