Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animators don't reset default values if GameObject was disabled via another animation clip!

Discussion in 'Animation' started by j-swan, Apr 20, 2021.

  1. j-swan

    j-swan

    Joined:
    Oct 21, 2013
    Posts:
    19
    Here is my issue:
    I am animating the opacity value of several gameobjects. Their default animation clip starts from 0 and goes to 1. So when they are enabled, it should start invisible and go to visible. If I disable, then re-enable these gameobjects, it correctly resets it back to 0.

    However, I am disabling them from an animation clip in the parent objects, by animating the GameObject IsActive.

    When I then re-enable the parent gameobject, and it initially enables those children, they start off with the opacity 1 before starting their clip at opacity 0 then playing the animation to opacity 1. This creates a jarring flash.

    This only happens if they disabled/enabled via a parent animation clip. NOT if I manually enable/disable.

    What causes this?