diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 2afe9ac35f0..2e87dbf9dad 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -283,10 +283,12 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim, Node *p_root_ov setup_pass++; for (int i = 0; i < a->get_track_count(); i++) { + p_anim->node_cache.write[i] = nullptr; + if (!a->track_is_enabled(i)) { continue; } - p_anim->node_cache.write[i] = nullptr; + Ref resource; Vector leftover_path; Node *child = parent->get_node_and_resource(a->track_get_path(i), resource, leftover_path);