AnimationEvents.RootMotionDidUpdate
Fired each frame when the animation graph produces a root motion delta for an entity.
Declaration
struct RootMotionDidUpdateOverview
By default, subscribing to this event suppresses automatic application of the root motion delta. The subscriber is then fully responsible for applying or discarding it.
To observe root motion without taking over application, set suppressesAutomaticApplication to false inside the handler:
scene.subscribe(to: AnimationEvents.RootMotionDidUpdate.self, on: entity) { event in
event.suppressesAutomaticApplication = false
// Root motion is still applied automatically; use the event for observation only.
print("Delta: \(event.rootMotionTransform)")
}To fully control application, leave the default (true) and apply the transform yourself:
scene.subscribe(to: AnimationEvents.RootMotionDidUpdate.self, on: entity) { event in
entity.transform = event.rootMotionTransform * entity.transform
}The event fires after graph evaluation but before the skeletal pose is applied to the mesh.