Skip to content

Commit

Permalink
Fixed Animation Playback Track not seeking properly
Browse files Browse the repository at this point in the history
  • Loading branch information
EspeuteClement committed Apr 21, 2020
1 parent cb1ae08 commit d6f24f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scene/animation/animation_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
if (anim->has_loop()) {
at_anim_pos = Math::fposmod(p_time - pos, anim->get_length()); //seek to loop
} else {
at_anim_pos = MAX(anim->get_length(), p_time - pos); //seek to end
at_anim_pos = MIN(anim->get_length(), p_time - pos); //seek to end
}

if (player->is_playing() || p_seeked) {
Expand Down Expand Up @@ -757,6 +757,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
}
} else {
player->play(anim_name);
player->seek(0.0, true);
nc->animation_playing = true;
playing_caches.insert(nc);
}
Expand Down

0 comments on commit d6f24f8

Please sign in to comment.