Search Unity

Create a copy of a TimelineAsset to modify at runtime

Discussion in 'Timeline' started by ryanas, Jul 18, 2019.

  1. ryanas

    ryanas

    Joined:
    Oct 2, 2013
    Posts:
    4
    Is there a way to create a copy of a TimelineAsset so I can modify the contents without having a reference to the original asset?

    I am working on a project where we need to modify the bindings of a track and the contents of a clip but it generates changes for the reference TimelineAsset and will flag up a change in our version control.

    This isn't really desirable because the content changes continuously which means team members will have changes in these timeline assets by just running the game.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    919
    Unfortunately no, or at least, not at runtime. Object.Instantiate won't work with Timeline assets because it will reference the tracks from the original instead of copying them.

    You can use the AssetDatabase to make a copy, but that only works in the Editor, not in a player.