Skip to content

Commit a7e6578

Browse files
authored
Fix animation transitions affecting other entities (#18572)
## Objective Fix #18557. ## Solution As described in the bug, `remaining_weight` should have been inside the loop. ## Testing Locally changed the `animated_mesh_control` example to spawn multiple meshes and play different transitions.
1 parent a08760b commit a7e6578

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/bevy_animation/src/transition.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ pub fn advance_transitions(
118118
// is divided between all the other layers, eventually culminating in the
119119
// currently-playing animation receiving whatever's left. This results in a
120120
// nicely normalized weight.
121-
let mut remaining_weight = 1.0;
122121
for (mut animation_transitions, mut player) in query.iter_mut() {
122+
let mut remaining_weight = 1.0;
123+
123124
for transition in &mut animation_transitions.transitions.iter_mut().rev() {
124125
// Decrease weight.
125126
transition.current_weight = (transition.current_weight

0 commit comments

Comments
 (0)