Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Getting notified when the timeline cycles back to the beginning (extrapolationMode loop)

Discussion in 'Timeline' started by OVezina, Sep 13, 2017.

  1. OVezina

    OVezina

    Joined:
    May 10, 2017
    Posts:
    2
    I'm looking for a way to get notified when my timeline ends and starts a second cycle (after looping).

    I tried putting break points on many methods like OnGraphStop, OnGraphStart and OnPlayableDestroy and they don't seem to get called when the timeline loops. Is there a way to know when the timeline is about to loop/is looping?

    Thank you!
     
    Last edited: Sep 13, 2017
  2. OVezina

    OVezina

    Joined:
    May 10, 2017
    Posts:
    2
    I found a way to do it! All good! (I don't know how to delete this thread lmao)
     
  3. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    129
    How did you solve this?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,003
    The simplest way is put a clip at the beginning of the timeline, then use OnBehaviourPlay. As long as the clip is less than the length of the timeline, it will get called on a loop.