I’m having an issue with Animator/Mecanim where I’m enabling/disabling objects outside of the animation while an animation is playing. There’s no enable/disable keys in the animation, yet as long as the animation is playing I cannot enable or disable objects influenced by the animation. Is there any fix for this?
Thanks in advance for the help.
1-day bump. This problem still exists and is making scripting extremely difficult and bug-prone.
2nd day bump
I’m using NGUI and Mecanim appears to be causing issues with that as well, but one problem at a time.
For now the solution I’ve implemented is to disable to sprite component rather than the object to hide it, but it really shouldn’t be this difficult. This solution only works because there are no keys in mecanim for the sprite component. As soon as I attempt to key anything related to the sprite component it also has the same issue where I’m no longer able to disable it until I disable the Mecanim animator first. Renabling the Mecanim animator causes it to force my previously-disabled objects active again.
Having the same issue with a gameobject. I activate it in the animator inside one animation that plays which then proceeds to play another animation where I have no keys in place to activate or disable the object. When I then try to disable the object via script or even in the editor it will not deactivate unless I deactivate it in another animator keyframe which I do not want to do.
Basically the animator overides an object even if there are no keys in place on the current animation playing. It remembers the state and continually forces its state from a animation that is no longer playing.