On Unity 5.5.2, when gameobject with animator is disabled then re-enabled, i can expect the animation is reset. And I am taking that advantages in my game so much. In 5.6 the behavior doesn’t like that and I tried to manually call the Animator.Rebind(), it doesn’t do anything.
Anyone has same problem ? Or anyone has already had solution ? Thank you.
The solution that worked for me is when an object gets disabled I do something like this
OnDisable()
{
Destroy(myAnimator);
}
And in OnEnable()
OnEnable()
{
if(myAnimator == null)
{
myAnimator = gameObject.AddComponent<Animator>();
myAnimator.runtimeAnimatorController = myPrefab.myAnimator.runtimeAnimatorController;
//Don't forget to set applyRootMotion and the avatar if needed
}
}