Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Check if timeline stopped playing

Discussion in 'Timeline' started by Evoroso, Aug 14, 2019.

  1. Evoroso

    Evoroso

    Joined:
    Jul 17, 2018
    Posts:
    87
    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:
    1,278
    Try this callback, or you can query the playing state.
     
  3. Evoroso

    Evoroso

    Joined:
    Jul 17, 2018
    Posts:
    87
    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:
    1,278
    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.
     
unityunity