Fixed Animation Playback Track not seeking properly
Fixes #38093.
(cherry picked from commit aa72af4f46
)
This commit is contained in:
parent
8519c803e4
commit
a259112d6e
1 changed files with 2 additions and 1 deletions
|
@ -725,7 +725,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
|
||||||
if (anim->has_loop()) {
|
if (anim->has_loop()) {
|
||||||
at_anim_pos = Math::fposmod(p_time - pos, anim->get_length()); //seek to loop
|
at_anim_pos = Math::fposmod(p_time - pos, anim->get_length()); //seek to loop
|
||||||
} else {
|
} 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) {
|
if (player->is_playing() || p_seeked) {
|
||||||
|
@ -753,6 +753,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player->play(anim_name);
|
player->play(anim_name);
|
||||||
|
player->seek(0.0, true);
|
||||||
nc->animation_playing = true;
|
nc->animation_playing = true;
|
||||||
playing_caches.insert(nc);
|
playing_caches.insert(nc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue