Disabling Mouse During a Cutscene Using Unity’s Timeline.
Deactivate mouse input during a cutscene
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.