diff options
author | kobewi <kobewi4e@gmail.com> | 2023-05-26 07:11:29 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-05-26 07:11:29 +0200 |
commit | 87a6145135bb063477d8b12a52639b8582e54a9f (patch) | |
tree | a1789e4ced99f9f0a9d90c08929c55879774247c /scene/animation/animation_player.cpp | |
parent | 2eec9a67d564b11326f44c5ef8b6b6f9aec251b9 (diff) | |
download | redot-engine-87a6145135bb063477d8b12a52639b8582e54a9f.tar.gz |
Fix AnimationPlayer cumulative speed_scale
Diffstat (limited to 'scene/animation/animation_player.cpp')
-rw-r--r-- | scene/animation/animation_player.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 9835e7a065..ebf5d03a76 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1766,7 +1766,7 @@ void AnimationPlayer::set_current_animation(const String &p_anim) { } else if (!is_playing()) { play(p_anim); } else if (playback.assigned != p_anim) { - float speed = get_playing_speed(); + float speed = playback.current.speed_scale; play(p_anim, -1.0, speed, signbit(speed)); } else { // Same animation, do not replay from start @@ -1779,7 +1779,7 @@ String AnimationPlayer::get_current_animation() const { void AnimationPlayer::set_assigned_animation(const String &p_anim) { if (is_playing()) { - float speed = get_playing_speed(); + float speed = playback.current.speed_scale; play(p_anim, -1.0, speed, signbit(speed)); } else { ERR_FAIL_COND_MSG(!animation_set.has(p_anim), vformat("Animation not found: %s.", p_anim)); |