Search Unity

Is it possible to get a reference to a Playable Director from the Signal it emits?

Discussion in 'Timeline' started by nathanjams, Apr 27, 2021.

  1. nathanjams

    nathanjams

    Joined:
    Jul 27, 2016
    Posts:
    304
    Hi,

    Is there anyway to attach or get a reference to the Playable Director from the signal it emits? Say i send a signal and want to get the length of the timeline it belongs to.

    Thanks
    Nathan
     
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Do you need the signal to be on a specific track?
    If the signal is on the marker track, then it gets executed in the context of the Playable Director object, so you can always query the Playable Director component.

    But otherwise no, signals don't provide backtracing to the Playable Director.

    If you want to pass along the Director, or the length of the Timeline, you'll need to create a custom marker.

    This tutorial I found gives a very simple explanation of how to do that in ~10 minutes
     
  3. nathanjams

    nathanjams

    Joined:
    Jul 27, 2016
    Posts:
    304
    Perfect, custom markers is EXACTLY what I was hoping for. Thank you!
     
    DavidGeoffroy likes this.