bevy
bevy copied to clipboard
Fix scene viewer animation switching
Objective
The scene_viewer example doesn't correctly switch between animations. It plays the new animation but also keeps playing any previous animations, so the animation graph mixes them all together.
I suspect this was accidentally broken when animation graphs were added in #11989, but I haven't confirmed.
Solution
Stop all animations and then play the new animation.
Testing
# Press enter to switch animation, or space to pause.
cargo run --example scene_viewer --features "free_camera" -- "assets/models/animated/Fox.glb"
I ran cargo run --example scene_viewer --features "free_camera" -- "assets/models/animated/Fox.glb” with your changes and did some combinations of pressing space and enter; it does indeed look good now!