Search Unity

Rootmotion of character different in Play mode

Discussion in 'Timeline' started by FiveFingerStudios, Jun 5, 2018.

  1. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    370
    I have a character that plays an idle, turn left 90 degrees, and then walk animation.

    I set it up in Timeline preview, and it looks great.

    The issue is that the character walks at 70 degrees in stead of 90 while in play mode....

    Anyone know the issue?
     
  2. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    790
    Do you have animation blending that aborts the turning animation before it finishes (or blends out from it towards the walking animation)?

    Anyway, discrepancies like that should not be happening between edit and play mode.
     
  3. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    370
    I do have the animations blending. I'll try it without the blends and reply to this post.

    If that is the case, then it would be very odd that Edit and Play modes show differently....
     
  4. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    370
    Ok, so after fooling around with it for a bit it seems that when I play mode, the animations aren’t blending....which is cause the discrepancies.

    So now this is a bit disturbing...as I thought what I previewed would be exactly what was shown when in play mode.

    Are they any tips or tricks when working with root motion animations?
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,082
    I haven't seen a case of animations on timeline not blending in playback when they do blend in preview. Is it possible to file a bug with this?
     
  6. GrapeApeGodzilla

    GrapeApeGodzilla

    Joined:
    Mar 20, 2015
    Posts:
    14
    Here is a video on my issue with timeline. It is a awesome fun tool and putting it together last night was really thrilling. But, when I press play or if I trigger the cut scene it is different from the preview. In this clip I only show it from when I press play since it is set as Awake.
     
  7. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    370
    You seem to be having a similar issue to me.

    @seant_unity
    How do I file a bug report?
     
  8. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,082
    @sbmhome - the easiest way is to use the "Report a bug..." option under the Help menu.

    @GrapeApeGodzilla - do your characters have state machines attached? If they have controllers, they will start relative to their current position/orientation in playmode, instead of 'absolute' position/orientation as shown in preview.
     
  9. GrapeApeGodzilla

    GrapeApeGodzilla

    Joined:
    Mar 20, 2015
    Posts:
    14
    @GrapeApeGodzilla - do your characters have state machines attached? If they have controllers, they will start relative to their current position/orientation in playmode, instead of 'absolute' position/orientation as shown in preview.[/QUOTE]

    Wow wasn't expecting that quick of a response. I submitted the bug report inside unity editor. I will remove the controllers or make the models only for the cut scene without controllers and then test it out to see if anything changes.
     
  10. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    370
    @sean_unity

    No need for me to file a bug....it was my dumb mistake (dont ask...lol). It looks like my issue was the animation controller on the character. Once I removed it, the animations play the same between preview mode and play mode.

    Now, my question is this...I have a character that I want to stand in an idle animation until the player walks up to him, then I want to start a Timeline. If I shouldn't have an animation controller attached, How should I be doing this?

    Btw, I want to be able to add new Timelines at a later time...and when the player walks up to him, depending on what the player picks...a different timeline would play. The key is that I want the character to be animated while waiting.
     
  11. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,082
    Good question, there are a few possibilities.

    1) You can swap characters when the timeline starts playing. That will only work if you aren't blending between them
    2) You can play the idle animation using timeline.
    3) You could animate a parent object for the movement. That might require using an override track to cancel out the root motion of the character.

    We are working to improve this in 2018.3 - we are making the starting offset a track option, instead of it being driven by the animator, which will make this particular use case straight forward to do.
     
  12. GrapeApeGodzilla

    GrapeApeGodzilla

    Joined:
    Mar 20, 2015
    Posts:
    14
    It worked. I kept the animator component on the character, but remove the animator controller. It played just like preview. The best thing is to have models that would be used in your timeline without the animator controller instead of using the prefabs that have the animator controller on them.
     
  13. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    370
    I'll go ahead and see if I can use #2 as I think that may work for us.

    Thanks for the suggestions and update.