Search Unity

My timeline can't change my character's transform?

Discussion in 'Timeline' started by Txzi, Mar 19, 2018.

  1. Txzi

    Txzi

    Joined:
    Mar 19, 2018
    Posts:
    2
    I made a scene to guide gamer know how to play this game.so I used the timeline .
    But I found that when the timeline is over,my characters returned to their begin transform:(

    ho can i solve it?
    or some else way to solve it?
    use script to record their transform?????
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,010
    This isn't the expected behaviour. Timeline normally leaves characters at the end pose/position they were in when the timeline stopped (either by the user, or finished).

    If they have an animator controller on their animator, control is returned to the state machine. Could that be a possibility?
     
  3. Txzi

    Txzi

    Joined:
    Mar 19, 2018
    Posts:
    2
    I don‘’t know,can i record the end position in the scripts??
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,010
    I see no reason why you couldn't.
     
  5. FabDynamic

    FabDynamic

    Joined:
    Jul 31, 2017
    Posts:
    24
    Could you send us a video showing us all the settings and options? (Screencast-o-matic or jing)
     
  6. whiteleon

    whiteleon

    Joined:
    Dec 25, 2017
    Posts:
    4
    I met the same issue. I tried to manually update the position by script when the timeline is over. But I then run into another problem that my character with animator cannot move(although the animator worked fine). it was locked at the end position when the timeline is over. The character can perform walk animation but there is no delta position.
     
  7. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,010
    Is the wrap mode on your playableDirector set to Hold? It sounds like timeline is somehow still attached to the animator.
     
  8. whiteleon

    whiteleon

    Joined:
    Dec 25, 2017
    Posts:
    4
    The wrap mode is once. I find out that there is a weird solution at other thread. I set the animator controller as null before the timeline start and reset the animator controller to the character animator when timeline is over. But there will be an obvious jitter at the character when the animator controller is reset to character(it switch to T pose for a frame and switch to normal)
     
    Last edited: Mar 27, 2018
  9. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,010
    By 'once' do you mean Hold or None? Hold will cause timeline to keep evaluating the last frame, where as none will release the timeline when complete.

    As for the weird solution, the existence of an animator controller will cause an object to start relative to it's current position. Otherwise it starts in absolute position. Also, if timeline always uses root motion which sounds like it may be relevant here.
     
  10. whiteleon

    whiteleon

    Joined:
    Dec 25, 2017
    Posts:
    4
    Sorry for not clear enough. The wrap mode is "None" for sure. I finally found that the jitter is caused by the camera transition moved by cinemachine. When the timeline is over, it will automatically set camera to the virtual camera of the cinemachine track at first frame.
    I use "playableDirector.state != PlayState.Playing" to detect if the timeline is over and disable the timeline gameObject.
    I could not find the way to precisely stop the timeline at the end frame and prevent it to set everything on the track back to the first frame.

    Thank you for your prompt reply.