Cutscenes tell a player what to expect in the next stage of the game or help them understand the storyline. Sometimes it is difficult to navigate the scene without a cutscene. Its better to have a cutscene rather than writing some text on the screen. Cutscenes are cool but creating them was never easy. After the release of Unity cinemachine, creating cutscene is a piece of cake.
In this tutorial, we will see how to add Unity cinemachine to your project and to use them to create cutscenes.
Is it possible to create a cutscene without Cinemachine?
YES! You can create a cutscene in Unity without cinemachine. You need to add animation to the camera and include a script to switch between the cameras you need. Its a tedious process especially when you can create is seamlessly with cinemachine.
One thing that you cannot achieve in this method is the smooth transition between cameras. As you switch cameras either using script or timeline, the switch will be abrupt and you need to make multiple corrections to camera angles to make it look good in your cutscene.
Cutscene with Cinemachine and Timeline
- Go to Window>Package Manager on the Unity editor.
- Search for Cinemachine.
- Click Install.
Adding Virtual Camera to your scene
- Go to Gameobject>Cinemachine>Virtual Camera
- Virtual camera gets added to your scene and a CineMachineBrain component is added to your main camera.
- Add three virtual cameras to the scene.
- Place them in three different location and set them in the view you want.
Creating a Timeline
- Click Create an Empty Gameobject.
- Go to Windows>Sequencing> Timeline.
- Select the Gameobject and click create on the Timeline window.
- Save the timeline with any name.
Adding a Cinemachine track
- Click on the + button .
- Select Cinemachine Track.
- Drag and drop the main camera to the Cinemachine Track.
- Drag and Drop the virtual cameras to the Timeline.
- You can overlap the virtual cameras to make a smooth transition between them.
- I am adding an Activation track for the fire particles.
- Adjust time and overlap period to get the best effect.
That’s it play the game and you should see the cutscene. Here is the end product of my tutorial.