Search Unity

How to swap playableAssets?

Discussion in 'Timeline' started by dmennenoh, Aug 5, 2019.

  1. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    319
    I have a timeline attached to a empty GO. I have three different timeline assets I created - but can't quite figure out how to swap them out and play then one I need. I created three public vars on my manager, of type PlayableAsset, and assigned the timelines to them.
    Then in my script I do like: timeline.playableAsset = qbPlay;
    But it doesn't work.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    917
    If 'timeline' in timeline.playableAsset = qbPlay is a playable director, then you need to call playableDirector.Play() afterwords.
     
  3. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    319
    Thank you, that did the trick!