diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index 836182a53e4df..d3dbed8406193 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -24,7 +24,7 @@ use bevy_time::Time; use bevy_transform::{prelude::Transform, TransformSystem}; use bevy_utils::hashbrown::HashMap; use bevy_utils::{ - tracing::{error, warn}, + tracing::{error, trace}, NoOpHash, }; use fixedbitset::FixedBitSet; @@ -755,9 +755,12 @@ pub fn animate_targets( .par_iter_mut() .for_each(|(id, target, name, (transform, morph_weights))| { let Ok((animation_player, animation_graph_handle)) = players.get(target.player) else { - warn!( - "Couldn't find the animation player {:?} for the target entity {:?} ({:?})", - target.player, id, name, + trace!( + "Either an animation player {:?} or a graph was missing for the target \ + entity {:?} ({:?}); no animations will play this frame", + target.player, + id, + name, ); return; }; diff --git a/examples/animation/animated_fox.rs b/examples/animation/animated_fox.rs index 0cd99028a800a..5483df3d503e4 100644 --- a/examples/animation/animated_fox.rs +++ b/examples/animation/animated_fox.rs @@ -3,7 +3,11 @@ use std::f32::consts::PI; use std::time::Duration; -use bevy::{animation::RepeatAnimation, pbr::CascadeShadowConfigBuilder, prelude::*}; +use bevy::{ + animation::{animate_targets, RepeatAnimation}, + pbr::CascadeShadowConfigBuilder, + prelude::*, +}; fn main() { App::new() @@ -13,10 +17,8 @@ fn main() { }) .add_plugins(DefaultPlugins) .add_systems(Startup, setup) - .add_systems( - Update, - (setup_scene_once_loaded, keyboard_animation_control), - ) + .add_systems(Update, setup_scene_once_loaded.before(animate_targets)) + .add_systems(Update, keyboard_animation_control) .run(); } diff --git a/examples/animation/animation_graph.rs b/examples/animation/animation_graph.rs index 259a91e7ad717..c81a7911e5806 100644 --- a/examples/animation/animation_graph.rs +++ b/examples/animation/animation_graph.rs @@ -7,6 +7,7 @@ use std::{fs::File, path::Path}; use bevy::{ + animation::animate_targets, color::palettes::{ basic::WHITE, css::{ANTIQUE_WHITE, DARK_GREEN}, @@ -84,7 +85,7 @@ fn main() { ..default() })) .add_systems(Startup, (setup_assets, setup_scene, setup_ui)) - .add_systems(PreUpdate, init_animations) + .add_systems(Update, init_animations.before(animate_targets)) .add_systems( Update, (handle_weight_drag, update_ui, sync_weights).chain(),