From 9d849c21ccde126dd841d4b9c89dfe3c1c865599 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 19 Aug 2019 13:48:19 +0200 Subject: [PATCH] fix animation freeze when playing animation from another AnimationPlayer Donated by IMVU, Inc. Fixes #31410 When we create an animation player with an animation from which we will start another AnimationPlayer's animation at the moment when that animation is already active - it will be stopped. When starting an animation with play() func all the 'outside' animations for animation player were removed (`_stop_playing_caches` func). This pr prevents this behaviour for the case when play is called for animation that's still active. This way the behaviour is the same between "Animation Playback track" and other tracks (tested with value track) --- scene/animation/animation_player.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 30aeebfdac3..051f8328821 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1200,7 +1200,9 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float } } - _stop_playing_caches(); + if (get_current_animation() != p_name) { + _stop_playing_caches(); + } c.current.from = &animation_set[name];