Disabling Mouse During a Cutscene Using Unity’s Timeline.

Objective: Create signal tracks to disable and enable the mouse during the intro cutscene.

In this game the player movement is indicated by clicking the screen, so during the cutscene we are going to disable the mouse input to make the player not able to move during it.

In order to implement this we have to use the signal tracks provided by Unity’s timeline. Signals allow us to execute code during a cutscene. In this case we are going to execute this function in the timeline controller script attached to the intro cutscene game object.

The first step is to create a signal track in the timeline window.

Then we have to assign the gameobject that contains the script with the code we want to execute. I assigned the intro cutscene game object and after that you have to save the signal receiver in a folder on your project.

Next we have to right click in the signal track to add the signal emitter.

In the inspector with the signal emitter selected we have to create a signal and save it in a folder of the project. In this case a created 2 signals, one to disable the mouse and another to enable it.

After that to call the function we have to create a “reaction”. The reaction is just selecting the script and the function in the inspector window.

And that’s it!!! We have the mouse disabled during the cutscene.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rusben Guzman

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.