Search Unity

Timeline affects root position of animated object

Discussion in 'Timeline' started by bibalek, Oct 10, 2018.

  1. bibalek

    bibalek

    Joined:
    Feb 13, 2017
    Posts:
    2
    Hello,

    I have a problem with animation clips on timeline. Here's a situation:

    Object has an animator with two animations clips: 'Idle' nad 'Walking'. 'Idle' animation moves only children, 'Walking' animations moves children and root transform to new position.
    In timeline I am using animations track with attached this root object, in mixer I am using 3 clips in order: 'Idle', 'Walking', 'Idle'.
    After 'Walking' animation, root changes its position, but when second Idle starts, it goes back on initial position (position from first 'Idle', before 'Walking' animation).

    Main question: How to tell second 'Idle' to keep root transform in position after 'Walking' animation?

    Other thing is, when I click ' Match offsets to Previos clip' on second 'Idle' clip in timeline, position in second 'Idle' after 'Walking' is ok, but position before 'Walking' (in first 'Idle') changes to the end position of 'Walking'.
    Why timeline doesn't create new instance of animation clip? Why root transform is affected by playing animation in timeline, while there is no root properties in animation clip? Do you have any ideas? Thanks in advance.
     

    Attached Files:

  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Root Transform is affected per track because deterministic root motion is, well, complicated. Matching the offsets is correct, but mixing root transform and non-root transform clips can give odd results. Partly because when a track has root transform, the entire track can be displaced with track offsets.

    Timeline doesn't create new instances of animation clips for memory reasons. But it does allow per clip offsets, so each clip should apply different offsets to the idle.

    I'd recommend changing the settings on the idle clip so it has root motion/transform.

    Which version of Unity is this? 2018.3 handles root transforms quite differently that previous versions.
     
  3. bibalek

    bibalek

    Joined:
    Feb 13, 2017
    Posts:
    2
    Thank you for answer. I forgot about version - it is 2017.4.1f1.

    You're right about allowing offset per clip, but unfortunately changing offset of clip which is used twice in track, changes offset of both of them.

    Another question about these animation clips - is it a good practice to animate root transform by itself? What about keeping structure: Parent with animator -> Subparent with animator -> all children and bones, where Parent animates Subparent in global space, Subparent animates children.

    I will try reproduce this problem in newest version of Unity, and give more info.