- Home /
animator.enabled =/= inspector checkbox
I cannot find this addressed anywhere, but here is the strange scenario:
If I set a character model's blendshapes and then enable the animator via script: animator.enabled = true; the blendshapes all slam to zero and lock.
-=HOWEVER=-
If in the exact same scenario I enable the animator manually instead via the inspector, the blendshapes are preserved and made additive to all animations.
What is different with animator.enabled? I can't see a reason why there should be any difference in behavior vs the checkbox in the inspector. Am I missing something?
Any hints or suggestions on how to get around this would be greatly appreciated.
I'm using 2018.4.27f1
Is it the same issue as on this forum? https://forum.unity.com/threads/losing-animator-state.307667/ Found the following solution on there:
GetComponent<Animator>().keepAnimatorControllerStateOnDisable = true;
That's a cool function, but it is unfortunately not usable in this scenario, as the game object is never disabled. Only the animator component is being turned on - just with very different results depending on if its by script or manually in the inspector.
Ahh alright, I'm not very familiar with the animator component. Hopefully someone can help you with a solution!
Your answer
