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

Question Model jumping to another place when usinig timeline

Discussion in 'Timeline' started by calpolican, Dec 16, 2020.

  1. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    So, after trying to do an animation with the timeline, I notice that as soon as I added a keyframe or animation, my character was jumping far away from it's original position.
    I haven't solve this issue, but this are the things I figured out:
    The issue comes because my character is made out of a few game objects, manly what important is that my character's model is a child of an object with the character's animator component. That is, the animator is in one object, and the model is in another that is child of the first.
    This is linked to the problem, since I realized that the only thing that is jumping is the model. More important is that I found that the amount of the displacement is identically to it's parent initial position... let me explain:
    if my character has the parent node at world (23,44,55) and the child at local (0,0,0), animating with the timelines makes the parent be at (23,44,55) and the child at local (23,44,55).
    So, I know that the problem is that the timeline is forcing the parent's position to the child's local position.
    So, is there any way to disable this behaviour?
    Any idea will be appreciated.
     
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    This is a bug. We're working on it right now, and this has been reported by someone else on the forums.
     
  3. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    Ok, anyway I can keep track of the progress? thanks
     
  4. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    calpolican likes this.
  5. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    By the way, you can also work around this issue by having your character transform layout match the transform layout in the Avatar. Or by just removing the Avatar from the animator if you don't need it.

    The issue comes from a mismatch between what the Animator thinks is the root joint (where the Animator is) and what the Avatar thinks the root is (the root joint of the original model)
     
  6. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    Thanks David,
    unfortunately I can't use this option, I need the avatar.
    I was thinking of this. I was going to update the child's local position in late update or something like that, zeroing out the vector. I don't like it that much though, since setting a transform position is an expensive operation to do every frame. Do you have a better option while we wait for a fix, by any chance?
     
  7. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Your best option is to make your Avatar match the hierarchy you are using at Runtime, or make your Runtime hierarchy match your Avatar.

    Your solution will also work, but it is more costly
     
  8. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    I can't change the hierarchy for reasons related to my game.
    I could add a second animator to my avatar, then switch with the original one when the timeline is on, and finally switch back when i'ts off. I'd also need to transfer all the position and rotation info from child to parent... I just don't think it's worth it. It would be easier if you guys just separate the animator component from the model's root transform; and publicly expose that variable for us to choose where our avatar is. You can still set a default behaviour but leaving room for customization.
    Is just better that you guys take 2 hours, 2 days, or whatever to solve this issue, than to have the whole community solivng the same issue several times and asking annoying questions. Specially consider is something that, ultimately, you'll have to do anyway, and that everyone's solution will be obsolete eventually. I appreciate a lot the work you guys do, just saying it's probably better that way.
     
    Last edited: Dec 21, 2020
  9. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    The fix for the bug is already done. I expect the fix to land somewhere in late January, due to the time it takes to backport changes, plus delays introduced by the holidays.

    It's more around getting your stuff running right now.
     
    calpolican likes this.
  10. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    Great news then, thanks for the info.