- Home /
How do you move Animations inside the Animator Controller hierarchy?
How do you move Animations inside an Animator Controller hierarchy? I see that, by default, there are animations inside a Button Animator Controller, but I can't move inside my own ones.
I tried to look for an answer, but I can't find one.
What more would you want to add? It's for a button... They are the states of the button... No idea if you can add more but I can't see any guides or documentation online.
I just wanted to organize the hierarchy that way, with the animations inside of the Animator Controller. But yea, I think you can't.
Those animation controllers: you created them using that "auto generate animations" button, right? Yeah, I'd also love to know how they put those motions INSIDE the controller.
Answer by Glurth · Sep 29, 2015 at 07:16 PM
Found it when manually creating an AnimationController in an Editor Script (like this http://docs.unity3d.com/ScriptReference/Animations.AnimatorController.html).
The answer is to use the AssetDatabase.AddObjectToAsset() function. First param is the AnimationClip you want to add, the second is the AnimationController you want to add it to. http://docs.unity3d.com/ScriptReference/AssetDatabase.AddObjectToAsset.html
P.S. I would certainly up-vote another answer that shows how to do this in the Editor without code...