Search Unity

object location different in Preview Mode vs Scene Playback

Discussion in 'Timeline' started by metaphysician, Jul 15, 2017.

  1. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    title pretty much says it all. set up a few characters doing some combat in Preview. plays back fine in Preview on the Timeline in the game or scene view, but if you start the scene,the animated objects move location and the offsets no longer make sense relative to new location. they don't seem to move to to world zero, however. taking off Root Motion on the Animator Controllers doesn't improve anything either.

    additionally, if this is previewed, looping will reset all characters positions correctly while scene playback will continue moving the characters position (presumably based on root motion?).

    is this a bug? do i need to bake the Timeline to a separate animation to play it back correctly? the UNITE demos looked totally seamless positionally between playback and preview modes, so i'm a little confused why i get such a different result. it does seem that a few others have reported similar symptoms though.

    some images to share:


    this is the shot from the Preview. camera and characters are positioned correctly. note second blue character on floor as well. And here is the playback version, at approximately the same time:

    The camera is clearly out of position as are all the other characters. the main player is rotated to her left. players feet are also below the level of the floor. the pink enemy has moved back, and the blue enemy is far to the left.

    any clue what's going on here? i asked a similar question on a different thread and at least one other person is getting different locations between scene playback and preview. for now i'm just working in preview as it seems most reliable. any help appreciated!
     
  2. AhrenM

    AhrenM

    Joined:
    Aug 30, 2014
    Posts:
    74
    I noticed some weirdness where some assets under timeline control were getting their local transform set to P0,0,0:R,0,0,0 on entering playmode. At least that is what it kind of looked like????

    Didn't find a workaround, just kind of backed off timeline for a bit. :-(

    [Edit: Disclaimer: I'm playing with 2017 beta 2, so I'm ok with weirdness]
     
  3. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Hi, we have a repro case for this bug and are currently looking into it.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Just an update - a fix will be in the 2017.1p3 version
     
  5. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    188
    Has this issue been fixed in 2017.1.0f3? Is there a link to the bug tracker for this issue?

    I'm experiencing the same problem. I was using Timeline to animate the path a seagull flies in my scene. After animating the flight, it looks fine in the timeline preview. However when I actually run the game, the path of the bird is rotated 90 degrees and is offset incorrectly. Checking "Apply Track Offsets" and moving the starting position / rotation seems to have no affect either.

    I think I worked around this in one case by deleting my animation and starting from scratch, but it just happened again. I think this is a bug.

    ---
    Also, I don't think it is clearly documented how the position is calculated when running an animation timeline. It seems to me that final result is:

    Local Position = Local Position from when object was added to timeline + Apply Track Offset (if enabled) + The value of the position on the animation timeline for the current frame

    The confusing part is that the animation timeline seems to remember the position the object was in when it was added to the timeline, and everything else is relative to that. Is this true? What if I want to change this value later? It doesn't seem like there is any way to view or alter this value without destroying the animation track and rebuilding it.
     
  6. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    There were some bugs when using recording and the offset position that have been fixed in 2017.1p3. We are specifically looking at issues 939548 and 933260 and much of the confusion is because of the how timeline and animation controllers interact.
    • When a controller is attached to the animator, animation tracks will start animating the character from it's current position (to the animations are locally placed). This was done to permit blending to/from gameplay smoothly. Any offsets initially applied are effectively ignored. If you are experience playback issues, try to remove the controller. (if it still persists please send in a bug report).
    • When no controller is attached, everything plays back exactly in place as it does in the editor.
    • Timeline always uses rootmotion, even if it's not indicated by the animator.
    We are working with the animation and UX teams to come up with a clearer way to set and indicate where animations should start from.

    I hope that clears up some confusion.

    Cheers
     
  7. Deleted User

    Deleted User

    Guest

    Horrible usability is horrible. This should be the user's choice. WITHOUT the workaround of removing the animator controller.
     
    d1favero likes this.
  8. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Agreed, it should be the users choice. It was an oversight on our part, and like I said, we are working with the appropriate teams to get a better solution asap.
     
  9. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    188
    Thanks for the information about the issue. After reading your response I did a few experiments on my own to make sure I understood how it was all working.

    For others, I'll mention the work around I'm using for now.

    Since the animators on my seagulls never modify the root position, the bug above causes all my animations to be based from (0,0,0) even if the preview shows them starting from somewhere else. So as a workaround, I make sure the seagulls I'm about to animate are positioned at (0,0,0) and rotated at (0,0,0) before I drag them into the timeline. That way, the preview animations match up with the actual animations.
     
  10. anilo

    anilo

    Joined:
    Feb 7, 2013
    Posts:
    31
    Any ideas on how to address this issue?
    Any hack? Any workaround?
    I tried the offset idea but it keeps moving my object to 0,0,0 still.
     
  11. anilo

    anilo

    Joined:
    Feb 7, 2013
    Posts:
    31
    I found a package called Default Playables.
    This has something for Tween. Can this be used to move an object from point A to point B using Timeline.
     
  12. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
  13. Roy-Massaad1

    Roy-Massaad1

    Joined:
    Jun 30, 2015
    Posts:
    16
    is it possible to play the animation in absolute reference not relative without getting rid of the controller ?

    because i have a similar problem

    i have an intro and outro, lets say player entering and exiting room animation that must be played at exact absolute position

    during those two events the player can control avatar manually in gameplay

    but when i play the outro its always plays with an offset relative to were the avatar in gameplay mode last was, not were i want it to play in absolute scene offset reference like i want it to

    for instance i cant get it to play exit animation from the door location
     
  14. akillingbeck

    akillingbeck

    Joined:
    Jun 13, 2017
    Posts:
    1
    @seant_unity This problem should be a lot more visible to users. I accidentally stumbled across this thread after 2 days of debugging. We were about to revert to Unity 5. Why is there a discrepancy between the playback between the editor and play mode? That seems like the actual bug here. If there wasn't I'm sure I would have found the solution in a couple of minutes
     
    d1favero likes this.
  15. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    We've been working with the animation team to improve that by allowing you to specify the behaviour (relative, or absolute) on the track, and trying to make this available asap.
     
  16. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    763
    I'm having a problem, unsure if it is because of the issue described in this post... however...

    In editor everything works fine, in the build one of my characters is rotated incorrectly.



    [Edit: Updating to 2017.1.1 fixed the issue...]
     
    Last edited: Sep 6, 2017
  17. larskroll

    larskroll

    Joined:
    Dec 17, 2013
    Posts:
    52
    still broken in 2017.2 right ?
     
  18. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    2017.3 Beta - Also broken.
     
    MadeFromPolygons likes this.
  19. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Wow, this is amazing, I just spent my money in the subscription thinking that the timeline would be really an awesome tool, and now I see all these bugs here and there! Not only the timeline is rendered unusable for animating characters positions and rotations (which is pretty much what any cut scene is made of), but also there is not event system in the timeline still... Really a disappointment! I see these posts from Unity saying that they are gonna fix this and that but at the end when I return almost 4 months later the issues still all over Unity. To top it off, the last Unity response in this post was in September 6, today is November 29. One would think that the issue was fix based on the long absence!
     
  20. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    Yes. I have been feeling tired of reporting bugs to Unity Team in recent years because they are not getting fixed. Every new Unity version feels more buggy. I am afraid I am losing hope day by day :(
     
    MadeFromPolygons likes this.
  21. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    763
    But there are no engine features behind the paywall, you could have used Timeline without paying anything o_O
     
  22. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    The trend I have seen with the Unity Engine is that many of the most important features for making games, end up mediocre at best. Water, Terrain Engine, Tree Builder... etc. Instead of making important features better, the keep adding new ones, without making the main ones really good. I don't recall the last time I saw a change in the Terrain, or the water, or the trees. Hell if I was to use the vegetation shader that came with unity, my trees wouldn't have especular light still... What! are you kidding me? do you get what I am saying. What about the terrain for example, the grass still sucking frame rate like a monster, and if you try to make a toll mountain, get ready for the stretching of the textures...This have been like this since the beginning.

    They engine has become jack of all trades, master of none. Anyway venting some frustration here...
     
  23. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    I cant stress enough how much I would prefer updated versions of the very old parts of the engine, over new features.

    Ultimately unity wont care because if they havent started paying attention to people saying this stuff, they never will.
     
    dadude123 likes this.
  24. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    ASAP not being 2 months later? Because I would consider this a very long time to go without communication, let alone saying "Get it to you ASAP".

    Please contact whoever controls what information can be relayed to the public, and sort out this mess. Timeline is so broken you should NOT be advertising it still.
     
  25. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Last edited: Dec 2, 2017
  26. knocking

    knocking

    Joined:
    Apr 10, 2014
    Posts:
    26
    Just posted a new thread for this, we would also like to know about any updates or fixes please.
     
  27. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Last edited: Dec 6, 2017
  28. Prarabdh

    Prarabdh

    Joined:
    Aug 19, 2017
    Posts:
    3
    Unity 2018.2 b; the latest one till this date, is still having this problem. I have a Gun which has to be spawned in a Weapon Slot when my player spawns. and an animator controller is assigned to the gun's animator. But when the game enters play mode, the gun is drastically rotated and positioned. Sad to say, but even when some bugs are known to the dev team, they are still not fixed even after 6 Updates :( .
     
  29. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    I wish this was the only important bug fix they ignored for months/years :(
     
  30. jessewwarner

    jessewwarner

    Joined:
    Jun 30, 2017
    Posts:
    8
    Still broken.. took me about 4 hours to realize that the animator was rotating objects that don't even have keyframes.
     
  31. panta

    panta

    Joined:
    Aug 10, 2012
    Posts:
    71
    Hi @seant_unity -

    This was very confusing to our team and it feels like undocumented behaviour. We spent all afternoon trying to figure out how make our Timelines animate relative to the Character's localPosition. We don't attach controllers to our Animator because we are using a workflow more similar to Unity's SimpleAnimation example where we animate using PlaybleGraphs instead of using AnimatorControllers directly in the Animator.

    From what I'm reading in your message, it seems we have 2 options if we want our Timeline animations to play locally:
    1. Place an AnimatorController in our Animator - we can't do this because we aren't using AnimatorControllers; we're using a PlayableGraph
    2. Place our character (an Animator component) under an empty gameObject, so that we can still move the Character's parent and have the timelines animate the Character at it's 0,0,0 local position
    Neither is a good option, and it feels like there should be an API to switch Timeline animations between local/world position animation modes rather than having the existence of an AnimatorController in the ANimator component decide this.

    So my question is this - Is there really now way to signal to the Timeline to play the animations local to the Character's position WITHOUT having an AnimatorController in the Animator? Is there an API to force the animations from Timeline to play locally? If not, it seems anyone using the Playables API instead of AnimationControllers basically cannot use Timelines for gameplay.
     
  32. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Exactly. The existence of a controller is what determines the initial transform right now, and definitely isn't ideal and why we are introducing the changes. The other option other than a controller is to use a parent game object on the character - Timeline only ever animates the localPosition/localRotation so you can manipulate the parent transform independently.
     
  33. Cleo_willo876

    Cleo_willo876

    Joined:
    May 18, 2017
    Posts:
    10
    Hello! For anyone facing these problems, what I have done to fix it was to remove the animator controller off any character or objects that'll be in animating in the timeline,(after-all you won't need them;)) and also..... Turn on the root motion on the character or they'll be moving on the spot.

    Here's a pic of what my problem was with animator controller on :
    Trouble.png

    and here it is in the preview:
    Trouble3.png
    and this is it after removing and applying the root motion to the character:
    Trouble4.png

    Let me know if this helped you out or not... :)
    If your interested in seeing this animated short film I'm making called "Run&Conquor" you can follow me on Instagram to keep updated on posts:
    Run&Conquor_Complete_02.jpg
     
    Last edited: Aug 12, 2018
  34. Cloud-Ninja

    Cloud-Ninja

    Joined:
    May 5, 2015
    Posts:
    32
    Did anyone test this with the 2018.3.0b1 Beta? I have and it doesn't seem to be fixed. I hope I'm wrong.....
     
  35. lisasims

    lisasims

    Joined:
    May 28, 2013
    Posts:
    21
    On the 2018.2.9f1 and similar problems....
     
  36. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    This is fixed in the 2018.3 beta, but you need to change the Track Offset field on any animation tracks that are upgraded. By default, the behaviour remains unchanged, but you can change it to Apply Transform Offset or Apply Scene Offset.

    Apply Transform Offset will play back the animation from absolute coordinates. E.g. for a cut-scene. Apply Scene Offset will start from the current position. Both of these will work with or without an animator controller.
     
  37. uscanime

    uscanime

    Joined:
    Jun 28, 2019
    Posts:
    3
    I'm currently working on a cutscene with 2018.3.12f1. The same problem is still there. I've struggled for quite some time and tried almost everything I can find through web. But nothing works. Is there any simple way to solve this problem?
     
  38. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    I don't know if it's related but please see my post here. Maybe it helps you.

    https://forum.unity.com/threads/tra...ut-they-dont-in-playmode.492442/#post-3986368
     
  39. uscanime

    uscanime

    Joined:
    Jun 28, 2019
    Posts:
    3
  40. d1favero

    d1favero

    Joined:
    Oct 14, 2011
    Posts:
    15
    2021 still happening...
     
  41. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
  42. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Then please file a bug report. It's unlikely that it's the same bug at this point.