I’m trying to get all the states from an animator so I can create UI buttons dynamically for every state in an animator. But can’t seem to find a way to do it. I found that you can get the current state but not all.
You can’t.
You can access the animator.runtimeAnimatorController.animationClips, but that’s just the clips, not the states.
If you want better animation scripting, you might be interested in Animancer (link in my signature). If for example you want to just have a list of animations which you can iterate through to create a play button for each of them, then Animancer would let you do exactly that - make an array or list of AnimationClips and then play them when needed, without wasting time setting up Animator Controllers.
1 Like