Search Unity

How can I get root motion from animation in timeline?

Discussion in 'Timeline' started by chokage, Apr 11, 2020.

  1. chokage

    chokage

    Joined:
    Nov 15, 2019
    Posts:
    1
    I want to change my character's position through animation root motion.But the animation is not in character'a animtor.So how can i get the root motion in my code?

    My unity version is 2019.2.6f1

    [SomeTimeLater]It seems that OnAnimatorMove included the timeline root motion,but the deltaposition was quite different from the animation.My character move quite farther then the animation root motion.But other animation root motion animator still works fine.That's the problem now i faced.
     
    Last edited: Apr 11, 2020
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    OnAnimatorMove will let you override the timeline driven root motion, but how Timeline's root motion is derived is different than an animator state machine, so using deltaPosition may give you different results. You may need to calculate your own deltaPosition.
     
  3. dyburke

    dyburke

    Joined:
    Nov 11, 2012
    Posts:
    16
    @seant_unity Hi, how can one tell if Timeline is scrubbing backwards in editor in OnAnimatorMove so one can reverse things that code did when Timeline was being scrubbed forward?
     
    Last edited: Aug 4, 2020