Search Unity

Signal Receiver trigger problem

Discussion in 'Timeline' started by zIyaGtVm, Apr 20, 2020.

  1. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Hi, I'm using Timeline and signals in 2019.3.
    In my use case the signal receiver only triggered when it is on the same gameobject which has a Playable Director.
    Are there any restrictions for signal receiver so that it can be triggered properly?
    Such as receiver should on the playableDirector GameObject? Receiver and PlayableDirector should in the same scene? Or the receiver's GameObject must be bind to timeline signal track source?
    In my opinion the signal emitter behaviour is more like broadcast, any gameobject could receiver the timeline signal by add a Receiver component which keeps a reference to SignalAsset(like the picture below)
    eg.png
    Am i missing anything? Any advice would be appreciated.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Use a signal track and you can specify who should get the signals emitted by the track in binding.

    Receiver and playable director still need to be in the same scene however. You could also create a custom receiver that would rebroadcast the signal however and to whomever you like.
     
  3. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Thanks seant, do you mean signal receiver will only receive signal from track binding?Default setting does not support receiving signals from other GameObject even in the same scene? (ObjectA play timeline, Object B receive, signal asset reaction won't trigger)
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Yes -- the receiver is has to be known by the timeline, either as a track binding, or if the signals are on the header, the playable director itself.
     
    zIyaGtVm likes this.
  5. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Ok I understand now:)
    Btw is there any method/api get the SignalEmitters on SignalTrack just like common one "TrackAsset.GetClips()".
     
  6. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    GetMarkers() will give you all markers, and you can cast them to signal emitters,
     
    zIyaGtVm likes this.