Animator State freezes
Hallo,
I am writing a UI component to display player stats and I want them to be animated. So I add an Animator component on runtime using:
_animator = gameObject.AddComponent<Animator>();
_animator.runtimeAnimatorController = Resources.Load("path") as RuntimeAnimatorController;
_animator.StartPlayback();
Unfortunately the progress of the Animator states are freezing at runtime. The progress bar of the state is not moving (like seen in the image). I can play with my state triggers and transition to other states but all other states have the same issue.
By chance I figured out that if I change the Speed value of a state at runtime it is playing again. But it is not set to low.. If I set it back to the default value it is still running. Seems to me that the speed change triggers something in Unity to update its internal logic.
I did try to set the Time.timeScale value as mentioned in other answers to this topic. I also removed all states and transitions in the animator editor and recreated them. The issue still accours..
Any ideas? Thank you!