Mechanim - OverrideController > Animator not updated?

Hello,

Overriding the animation controller in runtime :

  • Load from resource
  • Edit every state animation input.

But I cannot select the new animator graph to preview the connection and animation progression in runtime.
AutoLiveLink is enabled, and the every AnimationController wihtout overriding are updating in the runtime.

Also ther overrided controller is working good, no error.
I just would like to preview the graph X_X…

Any idea or tips how to preview an overrided Controller?

Thank you :slight_smile:

If you are on 5.2 this is a know issue and was fixed in patch release 5.2.1p1

(725767) - Mecanim: Fixed game object with override controller not showing the base controller when selecting the GameObject

I have a project with a character that has an animation controller attached with two states (state1 and state2). state1 is a walking animation and state2 is empty (none). I use the following code to try and set a clip to state2, but state2 → motion in the inspector stays empty.

public GameObject tstCharacter;
public AnimationClip tstClip;

private Animator anim;
private AnimatorOverrideController animOverrideController;

void Start()
{
anim = tstCharacter.GetComponent();

animOverrideController = new AnimatorOverrideController(anim.runtimeAnimatorController);
anim.runtimeAnimatorController = animOverrideController.runtimeAnimatorController;
// anim.runtimeAnimatorController = animOverrideController;
}

void Update()
{
animOverrideController[“state2”] = tstClip;
// animOverrideController[“Base Layer.state2”] = tstClip;

}

Apparently the system is set up to not replace motion in a state. Instead you can replace a clip with a certain name with a new clip. animOverrideController[“state2”] should be: animOverrideController[“clipname”]. Which makes it completely useless in cases where you have the same clip in more than one state. Like the ‘None’ clip when you start with an emtpy statemachine… great…

Yeah, it overrides based on clip names rather than state names which seems really stupid because it means you have to create empty dummy animations for no real reason and your scripts end up with hard coded strings for clip names on top of state and parameter names. I’ve never seen a situation where you would want it to work like that, but I don’t use Animator Controllers any more so it’s entirely possible that some people find it useful.

Also, you really shouldn’t necro a 4 year old thread when your issue is clearly not the same thing.