Search Unity

How to change the Bindings from the PlayableDirector/Timeline?

Discussion in 'Timeline' started by DragonDark99, Oct 16, 2018.

  1. DragonDark99

    DragonDark99

    Joined:
    Jun 6, 2017
    Posts:
    10
    Hello. I want to change the bindings from the PlayableDirector to make a cinematic where the player play some animations but the player model can be changed. for example a Cube move around an object in the Timeline. I want to change this Cube for a Sphere but without modify anything from the Timeline except the Cube via script. how I can made this?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Use TimelineAsset.GetOutputTracks() to find your specific track you want to bind (by name can work). Then pass that to playableDirector.SetGenericBinding(track, sphere.GetComponent<Animator>()). Then Play the playableDirector.

    The timeline asset is a fixed asset. It doesn't know what it is bound to. The playable director stores what is bound to which track. So the same timeline can be played on different playable directors, with different bindings.
     
    senkal_ and DragonDark99 like this.
  3. DragonDark99

    DragonDark99

    Joined:
    Jun 6, 2017
    Posts:
    10
    Thank You!