Search Unity

Unity 2019 - Error with keepAnimatorControllerStateOnDisable

Discussion in 'Scripting' started by JanDawid, May 10, 2019.

  1. JanDawid

    JanDawid

    Joined:
    Jul 7, 2014
    Posts:
    283
    I've updated my project from 2018.3.8f1 to 2019.1.0f2 and I can no longer use the setting on my Animator Controllers to keep the state on disable. This is the code I have:

    foreach (Animator a in fullObj.GetComponentsInChildren<Animator>())
    a.keepAnimatorControllerStateOnDisable = true;


    And this is the error I get:

    Assertion failed on expression: 'm_BindingsDataSet.m_GenericBindingConstant != NULL'
    UnityEngine.Animator:set_keepAnimatorControllerStateOnDisable(Boolean)


    I can't find another way to set this value other than to manually set it on each object in the editor through the Debug inspector of the Animator component... which is inconvenient, and really this should work.
     
    Last edited: May 10, 2019
  2. JanDawid

    JanDawid

    Joined:
    Jul 7, 2014
    Posts:
    283
  3. Danoli3

    Danoli3

    Joined:
    Sep 12, 2017
    Posts:
    14
    Happening on 2018.4.2 as well

    Any bug reports on this?
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    You should report this as a bug, as well as post a thread in the Animation forum.
     
  5. henriqueranj

    henriqueranj

    Joined:
    Feb 18, 2016
    Posts:
    177
    I am facing the same error now that I updated a project from Unity 2018.3.1f1 to 2018.4.2f1.

    This happens when applying
    _animator.keepAnimatorControllerStateOnDisable = true;
    when the GameObject is disabled.