Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Difference between single animation track and many for same Animator?

Discussion in 'Timeline' started by LaneFox, Jul 23, 2020.

  1. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,443
    We're exploring Timeline this week and I'm trying to basically just move objects around in the scene. I have a hierarchy of objects, a wrapper with an Animator, and individual animation files to move sub objects.

    Code (csharp):
    1. - Wrapper Object (Animator)
    2. ---- Box 1
    3. ---- Box 2
    4. ---- Box 3
    5. ---- Box 4
    My animations are something like this
    Code (csharp):
    1. - Move_Box1_ToPosition
    2. - Move_Box2_ToPosition
    3. - Move_Box3_ToPosition
    4. - Move_Box4_ToPosition
    I've disabled
    Write Defaults
    in all of the Animator States as I don't want to reset the entire transform hierarchy of everything under the Animator when playing an animation.

    However it appears when I use a single animation track and do those animations back to back then there are some issues with resetting when it moves into the next animation.

    When I use one animation track per each animation then the objects play their animation and move through the timeline as expected, not resetting.

    My question is why is this happening? Additionally, is there any significant performance impact to having ~50 Animation Tracks?
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,443
    Ok so this seems limited to the Editor. I'm basically just seeing different results when not in play mode. Likely related to my other post about scrubbing.

    It seems to be correct in Play mode.
     
    Last edited: Jul 23, 2020
  3. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    In editor mode, you will see the effect of the last animation track.

    In playmode, you will see them layer correctly.

    Alternatively you can use overrride tracks on a single animation tracks, which will preview correctly in both play and edit modes. This is also slightly more efficient than using multiple animation tracks - the animator will see it as a single graph, where as multiple animation tracks will be presented to the animation as multiple graphs that need to be blended.
     
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,443
    Thanks for the information @seant_unity - sorry for my frustration on these two threads >_<