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

Creating signals via scripts

Discussion in 'Timeline' started by hanoelleb, Mar 28, 2020.

  1. hanoelleb

    hanoelleb

    Joined:
    Mar 3, 2019
    Posts:
    1
    This is my first post so I apologize if I do something incorrectly.

    Is it possible to create and add a signal emitter to a track (specifically an AnimationTrack) through a script? I checked the TimelineAsset and AnimationTrack docs, but I couldn't find anything relevant to it and I couldn't find any examples of signals in scripts either.

    The animation track itself is made through a script so I can't use the timeline window to add it.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Yes, you can use TrackAsset.CreateMarker<SignalEmitter>(time) to add a signal emitter to any track that supports markers, even an AnimationTrack.