Skip to content

Commit

Permalink
Fix Animation Playback Track not seeking properly
Browse files Browse the repository at this point in the history
Reapply bugfix godotengine#38107
  • Loading branch information
BruceLiCong committed Mar 21, 2024
1 parent fe01776 commit 7adfba5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scene/animation/animation_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ void AnimationMixer::_blend_process(double p_delta, bool p_update_only) {
double at_anim_pos = 0.0;
switch (anim->get_loop_mode()) {
case Animation::LOOP_NONE: {
at_anim_pos = MAX((double)anim->get_length(), time - pos); //seek to end
at_anim_pos = MIN((double)anim->get_length(), time - pos); //seek to end
} break;
case Animation::LOOP_LINEAR: {
at_anim_pos = Math::fposmod(time - pos, (double)anim->get_length()); //seek to loop
Expand Down Expand Up @@ -1658,6 +1658,7 @@ void AnimationMixer::_blend_process(double p_delta, bool p_update_only) {
}
} else {
player2->play(anim_name);
player2->seek(0.0, true);
t->playing = true;
playing_caches.insert(t);
}
Expand Down

0 comments on commit 7adfba5

Please sign in to comment.