Przeglądaj źródła

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)
Unknown 6 lat temu
rodzic
commit
9d849c21cc
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      scene/animation/animation_player.cpp

+ 3 - 1
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];