Search Unity

Check if timeline stopped playing

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

  1. b4gieta

    b4gieta

    Joined:
    Jul 17, 2018
    Posts:
    97
    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,516
    Try this callback, or you can query the playing state.
     
    stefan-velnita likes this.
  3. b4gieta

    b4gieta

    Joined:
    Jul 17, 2018
    Posts:
    97
    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,516
    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.
     
    zeimhall likes this.
  5. Deleted User

    Deleted User

    Guest

    How to check if timeline is playing in preview mode with script in editor mode?