SetGenericBinding does nothing in builds, but work fine in Editor

Hi! I have a behavior that seems like a bug.

I am instantiating a Prefab with a PlayableDirector set on it, and the timeline asset is already set on it. There is one track that I need to bind after the instantiation, so I do just that this way:

PlayableDirector introCutscene = Instantiate(_encounterData.customIntro);
var timeline = introCutscene.playableAsset as TimelineAsset;
foreach (var trackAsset in timeline.GetOutputTracks()) {
    if (trackAsset is SignalTrack && trackAsset.name == "EncounterSignals") {
          var signalReceiver = GetComponent<SignalReceiver>();
          introCutscene.SetGenericBinding(trackAsset, signalReceiver);
          break;
      }
 }
introCutscene.Play();

The track is a signal track, so I bind a SignalReceiver component to the track. It works perfectly fine in the Editor, but it does not in a build (Mono Windows Standalone build).

I tried multiple ways to set the binding, calling Play before setting it, it always works in the Editor, never in a build.

Any idea?

Unity 2022.3.16, Timeline 1.7.6

Thanks!

And to add to the validations I did:

  • Yes SetGenericBinding is called in a build, the track is found.
  • After calling SetGenericBinding, I validated it by checking the Object with GetGenericBinding, and it seemed to be set correctly.
  • I tried setting the binding by looping on introCutscene.playableAsset.outputs instead of the tracks. Works in Editor, not in Build.

Does your PlayableDirector have the “Play On Awake” option on?
if so, then you may be binding after it is played, which won’t effect the result. (I think in editor it friendly recreates the PlayableGraph for you everytime you dou something for the convenience when editing)

(This is just a guess)

Play on Awake is off, since I want to control when the play starts.

1 Like