Don't trigger animation events when paused (#15677)
# Objective Pausing the `animated_fox` example perfectly as one of the feet hits the ground causes the event to be triggered every frame. Context: #15538 ## Solution Don't trigger animation events if the animation is paused. ## Testing Ran the example, I no longer see the issue.
This commit is contained in:
parent
6edb78a8c3
commit
70269ef758
@ -1143,6 +1143,7 @@ pub fn animate_targets(
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if !active_animation.paused {
|
||||||
// Trigger all animation events that occurred this tick, if any.
|
// Trigger all animation events that occurred this tick, if any.
|
||||||
if let Some(triggered_events) = TriggeredEvents::from_animation(
|
if let Some(triggered_events) = TriggeredEvents::from_animation(
|
||||||
AnimationEventTarget::Node(target_id),
|
AnimationEventTarget::Node(target_id),
|
||||||
@ -1164,6 +1165,7 @@ pub fn animate_targets(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let Some(curves) = clip.curves_for_target(target_id) else {
|
let Some(curves) = clip.curves_for_target(target_id) else {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user