rememberAnimationMixer
Creates and remembers a standalone AnimationMixer for imperative use — drive it from an OnFrame callback with the instance's Animator, mutating track weights from your own animation logic. Prefer AnimationState + rememberAnimationTrack for the declarative path.
val mixer = rememberAnimationMixer()
val walk = remember { mixer.addTrack(walkIndex) }
var animator by remember { mutableStateOf<Animator?>(null) }
GltfInstance(asset = character, onCreate = { animator = instance.getAnimator() })
OnFrame { frame -> animator?.let { mixer.apply(it, frame.deltaSeconds) } }Content copied to clipboard