Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Runtime Animator Controller Override resets animator variables ?

Discussion in 'Animation' started by Meishin, Oct 10, 2020.

  1. Meishin


    Apr 12, 2019
    Hi guys,

    In 2019.3 i was overriding Runtime Animator controller and everything was smooth, for instance ;
    Code (CSharp):
    2.         animator.SetBool("AutoTrigger", true);
    4.         // Override Animator if any
    5.         if (_AnimatorOverride != null)
    6.             animator.runtimeAnimatorController = _AnimatorOverride;
    7.         else
    8.             animator.runtimeAnimatorController = SavedState.Controller;
    Was running smoothly, i would then trigger whatever animation state i needed and it would pick up AutoTrigger value just fine.

    Now in 2020.1, when assigning a new runtimeAnimatorController, AutoTrigger just resets to False.

    Is this a new intended behavior ? Is there a way to avoid that ?
    Ofc In the example i don't really care, i just set up AutoTrigger after assigning Runtime Animator Controller and it worked, however this is very problematic for all other animator variables not linked to this system.

    Thanks in advance
    ptz4ever likes this.