Hi,
I am currently trying to mix animations on my character/mobs, have the lower body do one thing, upper body another and so on. This requires me to use Layers and the RuntimeAnimationController.
I am facing massive issues and want to complain a bit hoping maybe someone from Unity reads it.
So, the RuntimeAnimatorController has an array of AnimationClips. If you have, let’s say, “Walk” in the base layer and again “Walk” in another layer of the Animator (maybe a layer “Full Body” that overrides the rest instead of being overriden by it), then the RuntimeAnimatorController contains two clips with the name “Walk”.
If you have 3 layers and all have the same 3 animations, then the AnimationClips array in the RuntimeAnimatorController contains 9 clips.
Now this could be neat. It could be used to stop animations only on certain layers. Here is problem 1: You have Animator.Start(animName, layer); but you don’t have Animator.Stop(animName, layer).
I cannot store them in a Dictionary<namestring, Animation> either because they often have the same names.
Now I tried to work around this by iterating over the AnimationClips[ ] in the RuntimeAnimatorController, but those clips don’t know what layer they are from. The AnimatorController won’t tell you either.
So my suggestion or even a request is, give the AnimationClips a public int that has their layer in it, get-only.
Maybe even implement Animator.Stop(animName, layer); cause lots of people are going to need that anyway.
If anyone knows how to accomplish the things I currently call impossible, please let me know, thanks!