Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

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:
    5
    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:
    1,278
    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.
     
unityunity