Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved How do I create editable Timeline Animation Clips through script?

Discussion in 'Timeline' started by Ratslayer, Feb 20, 2021.

  1. Ratslayer

    Ratslayer

    Joined:
    Feb 6, 2014
    Posts:
    37
    Hi. I need to create an animation clip that is editable in timeline through an editor script. AFAIK this means that I need to save those clips as timeline sub assets, otherwise I can't edit them. How do I do that?
     
  2. Ratslayer

    Ratslayer

    Joined:
    Feb 6, 2014
    Posts:
    37
    Found it. AnimationTrack has a method "TimelineClip CreateRecordableClip(string name)" that does exactly that. Just make sure that TimelineAsset is saved to the AssetDatabase before calling that method, otherwise it can't save the clip as a subasset.