Search Unity

Creating animation output within graph creation process

Discussion in 'Timeline' started by palex-nx, Jun 4, 2020.

  1. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    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?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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.
     
    palex-nx likes this.