Animator Controller Organization

I’m sure this has been asked many times but I couldn’t be able to find any good answer.

I can tell my animator will get really messy after I finish with it. I am using Sub-State machines but they will only keep the base layer clean (I’m not even sure if it would be that clean after I’m done).

  1. Any general tips you can give about this?
  2. Is it possible to make multiple copies of “(UP) Base Layer”, “Exit” or “Entry” to keep connections from going rampant in sub-state machines? While adding no function at all, I think it would help keeping it organized a lot.

It would be nice to this a discussion about what is the best way to organize animator controller.

One of the ways to make Animator less annoying to operate is to use Animator.Play or Crossfade more often, meaning you can avoid having “intro” transitions, for instance, here’s how my animator for Revolver hands looks like

Screenshot

You can see that AmmoCheckStart and Loop are not even connected to anything else, because I play AmmoCheckEnd using Animator.Crossfade and it will automatically go back to “moving” state. I personally use parameters only for blend trees or if there’s a conditional exit from state.

For example, ReloadLoop can be interrupted by player using LMB, in this case transition to ReloadEnd will be instant. But if reload just ends because there aren’t any more ammo to put in, then I raise EndReload trigger and transition to ReloadEnd naturally

Following your example, I would personally remove transition from RunCycle to RunStop and just call it myself from code. It’s hard to tell what is RunStepE and RunStepS though

Stepping animation is seperated to two parts as StepS(tart), StepE(nd), there are no transition interpolation between animations that play from entry to exit, transition interpolations are used when animation isn’t going “start to end”. I have seen this in an old game and wanted to give it a try.

So when things get clustered or complicated you remove transitions from animator and join states in code and keep AC clean. I remember a guy on youtube putting all the animationx states side by side in AC and doing every thing in script too.

To be honest, while it is a nice method to keep AC clean, I didn’t quite like seperating state machine and putting some parts of it to script aspect of it. Still it is nice to knowing about this option when things start to get out of control.

Interesting, but I’d like to see how it works in practice. I wonder if there’s much advantage to this approach against just setting animation time directly? If you know step start is at 0.0 normalized time and step end at 0.5 then you can keep them in same animation clip and, again, manually transition to which one you need. It really depends on the end result you want to see.

I don’t think that’s very good approach! If your animations have explicit animation time, you should obviously use a transition, so that Animator will exit from state at appropriate time. You should combine both C# and State Machine to make the simplest setup possible. If all you want to play an animation right there and now, Animator.Crossfade is better than trigger, if you want to exit from state at a specific time then use parameter

It’s just that as you mentioned yourself, if you try to manage all transitions, animator gets messy VERY fast.
Not to mention transitions also seem to be non deterministic, I had a problem where I tried to synchronize two characters by using triggers, and sometimes one of them would just decide to start playing animation later for seemingly no reason.

Yeah pratically same, I also split the animation clip while doing this, but also prepared animations this setting in mind. Only plus is ;
StepS → StepE and StepS → RunStart animation transitions are without any interpolations. But animation states need to have “Has Exit Time” true to have any benefits from this.

Ah, If it comes to a point where I need to intervent AC with a script I would gladly put some shortcuts to keep it clean too. Still it feels like if I start using a script to intervine AC, I would most likely stop using AC mostly and go with script alone.