Search Unity

Blending animations with root motion reset player position

Discussion in 'Timeline' started by holy_3051_unity, Apr 28, 2020.

  1. holy_3051_unity

    holy_3051_unity

    Joined:
    Sep 24, 2019
    Posts:
    6
    I'm having a problem blending multiple animations in timeline. I use a character with root motion, the animations has root motion as well. When they blend, the root of the player moves back to the previous start clip position. Using a second animation track and blending them manually do the tick but doesn't seems to be the proper way.
    Am I doing something wrong or timeline works like that?

     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Right click on the second clip and select 'Match Offsets to Previous Clip'.
     
    freyzorr likes this.
  3. holy_3051_unity

    holy_3051_unity

    Joined:
    Sep 24, 2019
    Posts:
    6
    The character moves with root motio, the size of the character may change and his offset is not always the same so that option won't work for me.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Ah right....I understand, that makes a lot of sense. The individual clips are re-scaled for root motion, but it appears the offsets are not. That is definitely a bug, and a use case we missed.

    As for workarounds, the simplest is probably what you are doing with multiple tracks. Or use an animator controller for the character animation.

    Otherwise,a script to rescale/rematch the offsets manually after changing characters would be required. Or perhaps use OnAnimatorMove to make adjustments. I really wish I had a better answer here.
     
  5. holy_3051_unity

    holy_3051_unity

    Joined:
    Sep 24, 2019
    Posts:
    6
    Thanks. I hope this will be fixed soon. I'll go for the 2 animation tracks for now
     
  6. ChadrickEvans

    ChadrickEvans

    Joined:
    Mar 14, 2015
    Posts:
    46
    I'm having a similar issue with my project in a post on this forum too. I noticed you acknowledge it as a bug... Is there an issue tracker for this specific bug?
     
  7. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    Any news on this? Will this bug be addressed through the package manager?
     
  8. pjbaron

    pjbaron

    Joined:
    Jan 12, 2017
    Posts:
    53
    Same question 2021.3.10f1
    We're using root motion for a series of animations separated by a free-running chase-camera sequence. After the first root motion sequence, our character is permanently offset by the distance travelled in the first root-motion animation.
    I could physically move him, but I'd have to work out an exact offset for every single root-motion animation.
    Seems like a pretty major oversight... Is there really no 'reset root motion origin, to origin' option?
     
  9. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I was wondering if you put the character game object inside a container game object, could you update the parent local position to reflect the child location and set the child back to 0,0,0. Basically transfer the child location up to the parent (resetting the child back to zero) so you can do root animations on the child for the next movement... You would have to trigger some code to do this of course at the right time, but just an idea.