Using Signal Emitters to Access C# Scripts

addam davis
3 min readMay 19, 2023

--

Objective: Call functions using Timeline!

What are signal emitters? If we had an animation there is a button that you can use to add events. Those animation events will connect to a function. There used to be nothing like this for Timeline, but now there is. We can now call events in Timeline.

To do this let’s create a director with two objects childed to it.

Next we need two scripts to run individually. Attach the scripts accordingly.

We are going to create simple public functions. Create a simple movement method. This method will control a bool variable. Changing it from false to true. Then in the update method we will check for that bool and when it is true, we will manipulate the transform.

Now we can return to our director, and we need to have something inside. Drop in one of the objects as an activation. This is for the example; you can imagine there being other tracks going on in here.

With that done we can now go to our markers tab and in here we can add a signal emitter. If you click that we are going to have a create signal and add signal receiver. We are going to need to create both of those.

Let’s begin with the create signal and add a new one. Then select create signal receiver to the director.

In the new signal we are going to run a function. Now, currently the function is pulling from the signal receiver on director, but there are no scripts on the director. That’s ok, we can select the object then select the public function we created.

Now we can go back to the Timeline and add another signal emitter. If you click on the signal emitter you will need a new signal. Next you will need to drop the second object onto the signal and select the public function we created for the second object.

Now you should be able to play the editor and when the signal emitters go off the objects will begin to move.

This is how we can have Timeline run and send code signals and have things happen. This gives us access to so many new functions. We can create so many scenarios now.

--

--

No responses yet