Search Unity

Timeline preview different than Play Mode

Discussion in 'Timeline' started by brantnerm1409, Dec 16, 2017.

  1. brantnerm1409

    brantnerm1409

    Joined:
    Dec 14, 2017
    Posts:
    7
    Hello, I am bringing this discussion from the Cinemachine thread to this thread because Cinemachine was not the issue. Props to "Gregoryl" for still being kind enough to try to help me there. However the issue persists.

    From what I am to understand right now, I am using the timeline to set up a simple cutscene and I am using root motion to drive the character animations for the cutscene. The one problem I encountered was that when applying root motion to the character when I hit play mode it always wanted to jump to 0,0 because that is where it's root is centered.

    So I applied a root offset to the character so it would animate in the proper location.

    Now the issue is that the timeline showed perfect playback of what I wanted but when I hit play it appears as if the root offset is not correct because the character does not... well animate properly at all things like spawning in wrong locations and walking straight upwards.

    I did have a chat with someone on youtube who said this could be caused by a current bug in the timeline and I would just have to wait for a fix.

    My question is other than waiting or redoing how my animation is played(root motion), is there a fix for this?
     
    Mecasapien likes this.
  2. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Just letting you know that the next response will likely be something like: "we need to be able to reproduce the bug ourselves" (which is true)

    If you can show a screen shot if your exact setup (or multiple showing animation, timeline, the object,...) and explain step by step how someone else can have the problem as well, then the bug will most likely get fixed pretty fast.
     
    jc_unity940 likes this.
  3. brantnerm1409

    brantnerm1409

    Joined:
    Dec 14, 2017
    Posts:
    7
    Someone from Unity Technologies already replied in the first thread and they are working on a fix for the next release. My main goal here was hoping to find a workaround so that I can get an executable demo going.

    This is my test project: https://github.com/CarpeVexillum/CutsceneTest2.git
    It can be reproduced there.

    Or.

    1.) Apply root motion to an animated character
    2.) Set up the animation to play in the timeline
    3.) Apply an offset to the root in the timeline
    4.) View the offset working in the game view by pressing play in the timeline
    5.) Play the scene with the play button and view different results
     
  4. dactilardesign

    dactilardesign

    Joined:
    Jun 9, 2009
    Posts:
    68
  5. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Fixed in Unity 2018.1.
     
    Last edited: Jan 1, 2018
  6. TimmyTheTerrible

    TimmyTheTerrible

    Joined:
    Feb 18, 2017
    Posts:
    186
    The easiest way i found for static sequences, is to give each actor a parent with the same transform as the object. this way, we you select the timeline, it won't reset the actor to the origin of the scene, but the origin of the parent instead(which if the transform is the same, it won't budge). Then if you want to move or reposition the actor, drag its parent around and not the actually object.
     
  7. grossimatte

    grossimatte

    Joined:
    Mar 15, 2013
    Posts:
    43
    Nope, issue is still there, in the beta at least.
     
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    yeah.
     
  9. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    Hi,
    Quick question, on your character, is there an animation controller? if yes, what happen when you remove it?
     
    jakub_kucera and MahrCheen like this.
  10. MahrCheen

    MahrCheen

    Joined:
    Oct 27, 2016
    Posts:
    3
    Maany thanks :D seems unintuitive at first but it works
     
    thierry_unity likes this.
  11. RustyCrow

    RustyCrow

    Joined:
    Feb 28, 2014
    Posts:
    43
    This seems to be the only thread i found that is talking about a similar problem i have in my 2d game and this
    works but is this intended ?
    The animator and controller i use in the timeline is also used when i move my character so i thought it would only be natural to use the same walk animclips to create my shots, but is this wrong? should i double up and have 1 animclip for the Timeline and 1 for movement ?
    What is the ideal setup so we dont run into this issue where the preview and playmode dont sync unless you remove the animator controller.
     
  12. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    We've addressed this with 2018.3. The animation track now has options for 'Offsets'. 'Track Offset' let you start from a fixed position (relative the parent), and Scene Offsets take the position when the timeline started playing. They both work independent of having an animation controller.
     
    MlleBun likes this.
  13. RustyCrow

    RustyCrow

    Joined:
    Feb 28, 2014
    Posts:
    43
    Hello @seant_unity, thx for the respons on this old post, but my problem is different. Its not a positional problem but rather the results of a anim clips post-extrapolation result the sprite animation dosent hold the last frame.
    My character pulls out a phone and looks at it (so the last frame is character looking at phone) so HOLD the last frame. In preview mode this works fine, but in play mode the character snaps back to original(idle) sprite.
    When i now remove the controller from the animator everything works fine (preview/play).
     
    MadeFromPolygons likes this.
  14. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Oh right, that is completely different! I'm not even sure what would cause that, is there any chance you could log a bug so we could get the repro case?
     
  15. RustyCrow

    RustyCrow

    Joined:
    Feb 28, 2014
    Posts:
    43
    No problem @seant_unity , but il need some time(work) and i have never logged a bug before so not sure how to do it :confused:(but il figure it out). But i can now safely assume that this is a bug and do not feel bad on a hacky work around.
     
  16. SamTerrae

    SamTerrae

    Joined:
    Sep 10, 2019
    Posts:
    11
    Hey, the issue you described above is really like mine... Here my post:
    https://forum.unity.com/threads/ani...e-animation-state-after-timeline-ends.818244/
    I'm hoping someone will know how to fix it or maybe it's a bug of post-extrapolate :<
     
  17. SamTerrae

    SamTerrae

    Joined:
    Sep 10, 2019
    Posts:
    11
    Somehow, I think the prob comes from the Animator itself :< I'm using Blend Tree to control the Animation when character moving around.
    I set up 2 parameters "MoveX" and "MoveY" for 2D Simple Directional and use GetAxisRaw method.
    I believe when the Timeline processed, it didn't SetFloat to the parameters. As a consequence, when the Animator took the control back, it would use the Animation representing 2 parameters in the Blend Tree.