What is a Signal Emitter in Timeline
Objective: To understand what a Signal Emitter is and how it is used in our Timeline sequence.
What is a Signal Emitter in Timeline
Timeline signal emitters were established in Unity 2019.1 as a way to allow Timeline to communicate with outside systems of the project. The signal is made up of 3 pieces of key information, all playing a vital role to make this feature work — the Signal Asset, Signal Emitter and Signal Receiver.
Signal Asset
This is an asset that is stored in our project (in the Project window), that defines the signal event itself.
Signal Emitter
The signal emitter is this marker located in your Timeline window:
There are a couple of ways to get the signal emitter set up.
Option 1
The first is simply by dragging and dropping the signal asset into the Timeline window and it will drop a marker at that point.
Alternatively, we can click on the marker icon (which will show/hide all markers), and then when can right-click on this bar and select ‘Add Signal Emitter’, or, ‘Add Signal Emitter from Signal Asset’.
If you have an existing signal asset, you can click the bottom option. However, if you selected ‘Add Signal Emitter’, it will then tell you in the Inspector that you need to create a signal asset to use.
This emitter is a reference to our signal asset and will emit a signal at the time of the marker. Now, we need a component to receive the emitted signal (discussed below option 2).
Option 2
We can use something called a ‘Signal Track’. This is located in your Timeline window when you right-click:
This signal track is now looking for a game object which can be simply dragged into it. If this game object doesn’t have a signal receiver component attached to it, it will ask if you want to create one when dragging the game object in.
Signal Receiver
This is the component that is going to be looking out for signals that have been emitted and will react accordingly when it receives it.
Now, depending on which option you have chosen above to setup your signal emitter, this will affect which game object receives the signal. If you went with option 1, the game object that has the Playable Director component (which also has the Timeline asset attached to it) attached to it will receive the signal. Alternatively if you went with option 2 (signal track), the game object that was dragged into the empty field will receive the signals.
Keep an eye out for the next article ‘Using Signal Emitters in Timeline to Access C# Scripts’, that is going to look at creating a reaction for the signal receiver and how this all works in action!