rememberAnimationNames

The clip names of asset, indexed by animation index, or empty until the asset is ready. Look up an index by name — names.indexOf("Walk") — instead of hard-coding integers. Entries are null for unnamed clips.

val names = rememberAnimationNames(character)
val anim = rememberAnimationState(initialAnimationIndex = null)
// The names arrive with the asset, after the state's initial index is read.
LaunchedEffect(names) { anim.animationIndex = names.indexOf("Idle").takeIf { it >= 0 } }