mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Merge pull request #31943 from codecustard/Fixes_invalid_frames_on_reverse_anim
Fixes Reverse Animation Starting on First Frame
This commit is contained in:
@@ -604,10 +604,14 @@ bool AnimatedSprite::_is_playing() const {
|
||||
|
||||
void AnimatedSprite::play(const StringName &p_animation, const bool p_backwards) {
|
||||
|
||||
if (p_animation)
|
||||
set_animation(p_animation);
|
||||
|
||||
backwards = p_backwards;
|
||||
|
||||
if (p_animation) {
|
||||
set_animation(p_animation);
|
||||
if (backwards && get_frame() == 0)
|
||||
set_frame(frames->get_frame_count(p_animation) - 1);
|
||||
}
|
||||
|
||||
_set_playing(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user