AnimationState
Hoisted, observable playback state for a single glTF Animator, created with rememberAnimationState and passed to GltfInstance. It auto-advances on every frame and cross-fades smoothly whenever animationIndex changes, covering the common "play idle, blend into walk" case without dropping to the onUpdate escape hatch.
Filament's animator blends exactly two clips at a time (the incoming clip plus the outgoing one it is fading from), so this drives one active animation with an automatic transition rather than an arbitrary N-track mixer. For full manual control use GltfInstance's onUpdate and call the Animator directly.
val anim = rememberAnimationState(animationIndex = 0)
GltfInstance(asset = character, animationState = anim)
// later, from a click handler — cross-fades over crossFadeDuration seconds:
anim.animationIndex = walkIndexProperties
The animation to play. Assigning a new value cross-fades from the current one. Null pauses.
Cross-fade length in seconds applied when animationIndex changes. 0 = hard cut.
True while a cross-fade transition is in progress. Read-only.