Search Unity

How to create child track through code

Discussion in 'Timeline' started by DDewy, Apr 30, 2020.

  1. DDewy

    DDewy

    Joined:
    Dec 21, 2014
    Posts:
    4
    I'm using the ILayerable interface for my custom tracks and I'm trying to create an additional track layer during runtime (only in the editor)
    I can find how to get reference to the child tracks in the API but I can't find out how to create an additional layer for a track
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Use TimelineAsset.CreateTrack. The first parameter is the parent. For layered tracks, pass in the base track that owns all the layers.
     
  3. DDewy

    DDewy

    Joined:
    Dec 21, 2014
    Posts:
    4
    Thank you that worked :)