Merge pull request #31943 from codecustard/Fixes_invalid_frames_on_reverse_anim
Fixes Reverse Animation Starting on First Frame
This commit is contained in:
commit
2416fbb4e2
1 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue