Search Unity

Animator forces GameObject active state

Discussion in 'Editor & General Support' started by jerry-glasslab, Apr 22, 2014.

  1. jerry-glasslab

    jerry-glasslab

    Joined:
    Jan 14, 2014
    Posts:
    3
    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.
     
    Last edited: Apr 24, 2014
  2. jerry-glasslab

    jerry-glasslab

    Joined:
    Jan 14, 2014
    Posts:
    3
    1-day bump. This problem still exists and is making scripting extremely difficult and bug-prone.
     
  3. jerry-glasslab

    jerry-glasslab

    Joined:
    Jan 14, 2014
    Posts:
    3
    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.
     
  4. CosmicBoy

    CosmicBoy

    Joined:
    Apr 16, 2014
    Posts:
    35
    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.
     
  5. petemyster

    petemyster

    Joined:
    Aug 22, 2012
    Posts:
    1
    Also seeing this :(