Search Unity

Timeline disable root motion from animationclip and offset frustrations

Discussion in 'Timeline' started by Nieles_GH, Jun 30, 2017.

  1. Nieles_GH

    Nieles_GH

    Joined:
    Jun 26, 2017
    Posts:
    35
    A few things are now really bugging me in timeline and almost prevent me from using it.

    Scenario: I try to animate a character walking over a path, for this I have a walk clip that has motion offsets animated in the clip and a character with an animator.

    Frustrations:
    1) I need to make the gameobject that has the characters animator a child object of a new empty gameobject otherwise the character keeps animating on position (0,0,0). This destroys my whole character setup since I have to move all characters scripts to the new empty parent object and make references to the child to find the Animator. this goes against every bone in my body. Since it is much more impractical to setup.

    2) There is no way to disable the root motion from animation clip in timeline. So now the child object with the animator is moving forward away from the parent and I can't find a way to disable it. So I have to make a new clip without root motion especially for the timeline?

    Right now the timeline works very counter intuitive for me :(
     
    Last edited: Jun 30, 2017
  2. Nieles_GH

    Nieles_GH

    Joined:
    Jun 26, 2017
    Posts:
    35
    Found another 1:

    3) All objects referenced in the timeline need to be in the same scene. In my current setup I use a location in multiple levels all having their own intro and outro animations. My solution for this was add an additive scene to each level containing the extra objects needed for that levels animation. But for example the main character is always present in the default base scene. But now I'm losing the references and I will need to make sure all objects are in the same scene as the timelines director, again working against my most effiecient setup...
     
  3. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    70
    The solution we found to 'cancel' the root motion was to add an extra animation track to override the child's position / rotation to 0,0,0.

    The problem we found is that Timeline seems to be very flimsy at the moment. Doing this worked fine in one of our cutscenes.. but when we tried to do it on a second one.. Timeline would not record the position curve.

    We tried right clicking on the transform, and 'Add Keyframe', but it would not take. We tried hitting the 'record' button on the track, and moving the object, and again, it would only record the change in rotation, and not in position.

    So, we ended up, copy/pasting the 'good' timeline that had the 'cancel root motion' animation track over and over.
     
    Last edited: Jul 1, 2017
  4. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    194
    All three seem to be the same issues I ran into recently when testing this out. Documentation and case usage is pretty thin so I'm hoping there are workarounds but if not its kinda disappointing. It also seems a bit kludgy needing expose/resolve fields and what not to pass them to the graph.
     
  5. Nieles_GH

    Nieles_GH

    Joined:
    Jun 26, 2017
    Posts:
    35
    Yeah right now it only seems to work with a very specific way of setting up your objects/scene and assets. I talked with one of the developers at Unite and one of the developers did acknowledge this. And as he said: Unity should not force you to doing things a certain way. So hopefully they will make timeline a bit more flexible.
     
  6. thierry_unity

    thierry_unity

    Unity Technologies

    Joined:
    Jun 10, 2015
    Posts:
    166
    Hi @Nieles_GH
    Would it be possible for you to provide us a small sample of what you are trying to do? That would be really helpful!

    1) Good news! in 2017.1.0f1 you are able to record root motion on an humanoid or generic character without using the Parent object workaround. Simply need to create another track with the same object where you record the RootmotionAnimation .gif

    2)You can disable the root motion on the animator component itself but I'm not sure if it's really what you want here. The sample I talked earlier would help us figure that one out.

    3) Unfortunately it's not a Timeline only issue, it is not possible to cross reference objects between scenes. The issue here is actually that Timeline is allowing you to do that in the first place. For example, If you try to cross reference a camera with a script, the field will never let you drop the object. nope.gif

    hope that helps a little.
     
  7. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    342
    Hi,

    I'm also trying to disable root motion for an animation clip in the timeline. I am moving the character through a motion tween track that I built ... I do not want any x/y/z movement from the model's walk animation. Disabling "Apply Root Motion" on the animator does not stop this. How do I turn this off?
     
  8. jayanam_games

    jayanam_games

    Joined:
    Jul 9, 2013
    Posts:
    41
    Same for me, disable root motion has no effect on 1) After stoppnig the game my character is moved to "somewhere", the x or sometime y axis values are reset to 0.
     
  9. thierry_unity

    thierry_unity

    Unity Technologies

    Joined:
    Jun 10, 2015
    Posts:
    166
    Unfortunately, right now it's not possible to do what you are asking using timeline. We are already thinking of ways how to solve this issue. The only way I can see you could make it work is to actually disable the root motion directly on the clip by masking it (if it's an humanoid it seem to be a little tricky). The problem with that is it will affect the source material you are using.
    I'll try to update this thread when we have other workarounds or ideas how to solve that issue.
     
  10. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    51
    In Unity 2017.3, disabling root motion on the Animator has no effect at all, and root motion is still applied. There is a huge disconnect between what you see in-editor by scrubbing, and what then subsequently happens when you hit play mode. In one particular timeline setup, I have characters being offset by 1000s of meters in play mode, and I can find no way to correct this and to make it look like it does in edit mode.
     
    Last edited: Jan 18, 2018
  11. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    111
    mgeorgedeveoper -> getting the same problem here (2017.3.f3). Any ETA on that issue Thierry ?
     
  12. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    51
    OK so it seems that as soon as any kind of root motion is used in Timeline, you get some random or otherwise incorrect initial positions for the animated object, but there are slightly different scenarios with different workarounds.

    One scenario was exactly this:

    https://issuetracker.unity3d.com/is...tent-result-between-the-preview-and-play-mode

    I fixed it by using Timeline to "animate" the parent of the actual animated object into the correct position, with the actual animated object starting at 0,0,0 within the parent.

    In another scenario, this "fix" doesn't work for me. In this case, the animated characters are within a moving dropship. Something here probably further confused Timeline. Here, the ONLY fix I could find was to use "Bake Into Pose" within the animation import settings, to essentially forcefully get rid of any root motion adjustments to the root bone. The characters within the dropship are now always at 0,0,0 within their respective dummy parent objects, and they stay at 0,0,0 during all blended animations.
     
  13. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,018
    Hello! How to get the character moving if theres no root motion in the animation?
     
  14. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    745
    Timeline always applies root motion, so root transform animation won't apply unless you generate root motion on the animation clip. I expect this to change for 2018.3, and for all root transforms to be supported.
     
    mattis89 likes this.
  15. danbfx

    danbfx

    Joined:
    Feb 22, 2011
    Posts:
    37
    Hi there,

    we just have a looped animation. Every time the timeline loops it adds an offset. The whole point was to replicate animation precisely. How could we achieve this?

    Thanks
     
  16. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    745
    Is the offset on the track, timeline clip or animation clip?
     
  17. cb_short223

    cb_short223

    Joined:
    Mar 29, 2018
    Posts:
    2
    Same exact issue for me as danbfx. I have an animation clip of a walk cycle imported via fbx. I'm trying to have a walk cycle that snaps back to its start position and not walk away to infinity.
     
  18. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    745
    If the issue is when the timeline is looping, then the only solution right now is detach the controller on the animator. 2018.3 has a change to make the initial offset be a track property, and it would let you achieve this independent of the controller.
     
    panta likes this.
  19. cb_short223

    cb_short223

    Joined:
    Mar 29, 2018
    Posts:
    2
    Thank you for your reply. I forgot to mention I am currently on v2017.31f1 and will update once our current project is finished. When I detach the controller, what is the procedure to animate it when in play mode? (noob question)
     
  20. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    128
    @danbfx did you manage to do that?
    @seant_unity I'm just moving a cube to left, then right and loop that. Running the animation as legacy works, the cube snaps back to the center and starts from there. Running the clip in timeline adds offset. I extended the playtime to 3 times the clip length and enabled the clips loop time. Apply Root Motion is disabled on the Animator and Loop Pose is disabled on the clip. I can also clearly see the gap in positions of the curves in the Timeline curve portion of the clip.
    How do I get a root GameObject that is animated to loop it's animation without offsets?

    [Unity 2019.1.0a12]
     
  21. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    745
    You are right, looping the clip automatically loops the offsets. Simplest solution is to use multiple copies of the clip.
     
  22. Alexees

    Alexees

    Joined:
    Nov 8, 2017
    Posts:
    128
    Is this behaviour intended, or does this happen out of the box due to Timeline being based on the same foundation as the animator is? the same happens when just using an Animator with just that animation and use root motion on it.
    Wouldn't it make sense to reflect the bool flag within timeline and make it toggleable on both ends?