Creating animation output within graph creation process

Hello unity community!
I’d like my custom track to instantiate a prefab and play animation on it. But I’ve noticed if I call the AnimationPlayableOutput.Create method from my CreateTrackMixer override it breaks the entire mixer playable behaviour. Specifically this mixer do not receives OnBehaviourPlay/Pause callbacks wich breaks everything consequently. I’ve already solved the problem by connecting my animations from the first OnGraphStart callback but I’d like to know why this happens and if there’s any better solution for my problem?

During Timelines compilation process (i.e. CreateTrack, CreatePlayable), it builds the graph with a very specific ordering of outputs, assuming it is the only one creating outputs. Creating a new output in CreateTrack mixer breaks that assumption.

Doing it OnGraphStart should work just fine.

1 Like