Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

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:
    42
    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:
    42
    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:
    72
    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:
    243
    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:
    42
    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:
    172
    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:
    347
    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:
    172
    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:
    125
    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,046
    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:
    863
    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:
    863
    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:
    863
    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:
    150
    @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:
    863
    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:
    150
    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?
     
  23. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    831
    I'm not sure what I'm doing wrong but I have character in my scene. I wanted to add animation and audio so I thought timeline would be perfect. I set that up all appears ok. I press play to test and the cutscene is taking place underneath the earth at position 0,0,0. Is there a way to play the cutscene at the location my NPC should be in the gameworld?
     
  24. Nieles_GH

    Nieles_GH

    Joined:
    Jun 26, 2017
    Posts:
    42
    Don't animate the position of the root object, instead animate the position of a child object. This way the root object of your NPC stays in the world and isn't touched by the animation.
     
    AndyNeoman likes this.
  25. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    863
    If you are 2018.3 or higher, you can also set the animation track to Scene Offsets. It will start playing from where ever it is.
     
    AndyNeoman and Nieles_GH like this.
  26. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    831
    Thanks for the replies guys I will give them a try.
     
  27. luch85

    luch85

    Joined:
    Apr 7, 2019
    Posts:
    5
    Are there any updates on this issue? my fingers are crossed.
     
  28. luch85

    luch85

    Joined:
    Apr 7, 2019
    Posts:
    5
    I'm having a similar issue here: https://forum.unity.com/threads/root-motion-for-timeline-player-animation.667783/

    The character animations work great for me on the timeline when I don't have a Character Controller attached. So I'm thinking, is there a way to have two characters, one that acts out the timeline Cut Scenes and when it's done, that character is disabled and the playable character (with the character controller) is enabled in it's place?

    Would need to transfer the position of the character at the end of the sequence to the playable character, but it seems like a much better alternative to messing with root motion inside scripts.
     
  29. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    863
    @luch85 Which issue in particular? 2018.3 address many root motion issues by introducing different offset modes. Scene offsets start the character from where ever it is when the timeline starts, for instance.
     
    mattis89 likes this.
  30. chubaski

    chubaski

    Joined:
    Nov 27, 2015
    Posts:
    3
    Hii guys and unity technology. Am having a timeline issue here. First when i animate a character in the scene and press the play button, the character disappears from the scene to another location(seems like the offset). How can i fix this

    Secondly, when i add the character in the timeline and add animation track, i add the animation clip that i want to us, but when i hit play the character does not play the animation or the timeline wont play the animation. What exactly is going on and how can i fix it

    Thirdly am having a yellow warning sign error in the console "You are recording with an initial rotation offset. This may result in a misrepresentation of euler angles. Whe recording transform properties,it is recommended to reset rotation prior to recording ". What??
     
  31. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    863
    1) Which offsets are you using on the track? Track Offsets will place the character at a specific translation/rotation and that is the default. Scene offsets will keep the character where it is and start animating from there.

    2) This could be many things. Is the animator disabled or the gameObject inactive? What type of character and animation are you using (humanoid or generic)? Is the animation clip legacy? (Timeline typically doesn't allow that).

    3) Prior to using the recording feature, reset the rotation of the gameObject to 0,0,0. When recording translation or rotation, both the initial position and rotation is copied to offsets. This prevents the need to record both rotation and translation at each key, and makes the rotation curves more in line with what you are recording, since all translation and rotation keys are recorded relative to the initial offsets.
     
  32. meichen8050753

    meichen8050753

    Joined:
    Jan 16, 2017
    Posts:
    6
    If I use Scene offsets, Then I can't move the character anyway, eg: walk forward (change transform's position like transform tween track) with animation;
    If I use recording feature, Then I can't set the origin position anyway except the recorded one like I wan't play a timeline action width an enemy, the enemy can walk in sence with AI ;
    I solved this problem only the way to copy the animation and set to Root node option to None;
    I just want thimeline do not set the position when play the animation with set Root node, can anyway to solve this problem?
     
    Last edited: Jun 11, 2019
  33. marvalshot

    marvalshot

    Joined:
    Dec 29, 2013
    Posts:
    146
  34. meichen8050753

    meichen8050753

    Joined:
    Jan 16, 2017
    Posts:
    6
    what do you means Eww.....
     
  35. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    863
    If the animations are writing the root node, then I don't think you can override it, even with an avatar mask. The animation track in Timeline will pick up on the animation having root animation and try to make appropriate corrections and always write.

    So, having your clips not write to the root is one way. Using OnAnimatorMove() in a monobehaviour and not applying motion should work as well.