Unity 5.5/5.6 Animator issue

I am having problems resetting the animator.
I was using 5.2 prior to moving to the 5.6.

To reset the animator I would just disable and then enable the game object carrying the animator component. This would restart the animator from the beginning. This does not seem to work in 5.6. The animator plays the first time and then when disable and enable the game object I find the animator in the same frame it left off.

Any ideas?

You could have a trigger that goes from any state to the initial state, and fire that off?

The solution that worked for me is when an object gets disabled I do something like this


And in OnEnable()

     if(myAnimator == null)
          myAnimator = gameObject.AddComponent<Animator>();
          myAnimator.runtimeAnimatorController = myPrefab.myAnimator.runtimeAnimatorController;
          //Don't forget to set applyRootMotion and the avatar if needed

You need to go to the EXIT state, then it works. At least for me.