The event raised each frame when a new root motion delta is produced for an entity.
Root motion is locomotion that's authored into an animation itself — for example, a
run cycle whose root joint advances forward — rather than driven by code. Each
frame's contribution is reported as a ``rootMotionTransform`` delta, which the
system applies to the entity's transform automatically. The event fires after
animation evaluation but before the resulting skeletal pose is applied to the mesh.
Subscribe to this event when you need to take over root motion application —
for example, to project the delta onto a navigation surface or to reject motion
on collision. By default, subscribing through `scene.subscribe(to:on:)` suppresses
the automatic application; the subscriber is then fully responsible for applying
or discarding the delta.
### Take over root motion application
```swift
scene.subscribe(to: AnimationEvents.RootMotionDidUpdate.self, on: entity) { event in
entity.transform = event.rootMotionTransform * entity.transform
}
```
### Observe root motion without taking over
To observe the delta while leaving automatic application in place, set
``suppressesAutomaticApplication`` to `false` inside the handler:
```swift
scene.subscribe(to: AnimationEvents.RootMotionDidUpdate.self, on: entity) { event in
event.suppressesAutomaticApplication = false
print("Delta: \(event.rootMotionTransform)")
}
```
Members (5)
get · iOS 27.0+
rootMotionTransform
TypeScript
get rootMotionTransform(): Transform
Swift declaration
let rootMotionTransform: Transform
The change in position and orientation since the previous frame.
This value is the delta from the previous frame, not a cumulative transform.
get · iOS 27.0+
suppressesAutomaticApplication
TypeScript
get suppressesAutomaticApplication(): boolean
Swift declaration
var suppressesAutomaticApplication: Bool { get nonmutating set }
A Boolean value that controls whether subscribing to the event suppresses
automatic application of the root motion delta.
The default value is `true` — while the event has subscribers, the system
doesn't apply the delta automatically and the subscriber takes over. Set to
`false` to keep automatic application in place while still observing the event.
- Note: This property only takes effect when subscribing through
``scene.subscribe(to:on:)``. Changes made via ``scene.publisher(for:on:)`` aren't
written back to the engine.
set · iOS 27.0+
suppressesAutomaticApplication
TypeScript
set suppressesAutomaticApplication(value: boolean)
Swift declaration
var suppressesAutomaticApplication: Bool { get nonmutating set }
A Boolean value that controls whether subscribing to the event suppresses
automatic application of the root motion delta.
The default value is `true` — while the event has subscribers, the system
doesn't apply the delta automatically and the subscriber takes over. Set to
`false` to keep automatic application in place while still observing the event.
- Note: This property only takes effect when subscribing through
``scene.subscribe(to:on:)``. Changes made via ``scene.publisher(for:on:)`` aren't
written back to the engine.
get · iOS 27.0+
entity
TypeScript
get entity(): Entity
Swift declaration
let entity: Entity
The entity the root motion delta was produced for.
get · iOS 27.0+
deltaTime
TypeScript
get deltaTime(): number
Swift declaration
let deltaTime: TimeInterval
The elapsed time since the last update, in seconds.