diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-15 11:33:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 11:33:34 +0200 |
commit | f2c44949c07e5ec2aadf519fca98e5bb1517f74c (patch) | |
tree | c84d60e65aeba297fa955c338b29ededd9a1612f | |
parent | 3b0c195ecdd09dcad5a8fdd106e4353b1e26d538 (diff) | |
parent | aa72af4f4631ddcb2cc35a5b5facde3a6737f981 (diff) |
Merge pull request #38107 from EspeuteClement/master
-rw-r--r-- | scene/animation/animation_player.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index f6091f224c..5825a35030 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -737,7 +737,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double if (anim->has_loop()) { at_anim_pos = Math::fposmod(p_time - pos, (double)anim->get_length()); //seek to loop } else { - at_anim_pos = MAX((double)anim->get_length(), p_time - pos); //seek to end + at_anim_pos = MIN((double)anim->get_length(), p_time - pos); //seek to end } if (player->is_playing() || p_seeked) { @@ -765,6 +765,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, double } } else { player->play(anim_name); + player->seek(0.0, true); nc->animation_playing = true; playing_caches.insert(nc); } |