Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Check if timeline stopped playing

Discussion in 'Timeline' started by Evoroso, Aug 14, 2019 at 9:55 AM.

  1. Evoroso

    Evoroso

    Joined:
    Jul 17, 2018
    Posts:
    79
    Hi
    I'm making script for missions to my game. I want it to set "mission" to null when timeline is finished. Is there an if statement to check it? I'm reading documentation but I don't know how it's supposed to work.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    909
    Try this callback, or you can query the playing state.
     
  3. Evoroso

    Evoroso

    Joined:
    Jul 17, 2018
    Posts:
    79
    How can I assign this state to Playable Director? (Timeline is in game object other than script) How can I use it as an if statement?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    909
    if (playableDirector.state == PlayState.Paused) will check if the timeline is not playing (yes, Paused means stopped). .Play() and Stop() are the calls to change the state, if that is what you mean.