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

BUG? Hidden duplicate AnimationClips?

Discussion in 'Animation' started by Pharan, Mar 12, 2016.

  1. Pharan

    Pharan

    Joined:
    Oct 28, 2013
    Posts:
    102
    Unity 5.3.3p1

    With a Mecanim Animation Controller asset selected:
    When I drag an AnimationClip onto the Animator window, it adds it as an Animator State.
    If I select that new Animator State, and then click on its field labeled "Motion", it highlights the AnimationClip I used to create it.

    Here's the weird part:
    When I press CTRL+D, it duplicates the Animator State.
    If I select that duplicate, and then click on the field labeled "Motion", it doesn't highlight the original AnimationClip.

    That was suspicious, so I used Debug.Log on that duplicate Animator State and found it has a duplicate AnimationClip assigned to it. It's a new instance. (A ReferenceEquals returns false. It has a different hashcode and instance id. Changes to the original AnimationClip don't get applied to it.) This new instance also has a the HideFlags (HideInHierarchy | HideInInspector), just like the Animator State object.

    This is a bug, right? A duplicate Animator State should refer to the original AnimationClip. 'cause there's no way to edit the hidden duplicate AnimationClip. At the very least, it's unintuitive to duplicate the AnimationClip when you duplicate a state machine state.
     
    Last edited: Mar 12, 2016