Cutscenes
How to set up basic cutscenes with Cinemachine.
Last updated
How to set up basic cutscenes with Cinemachine.
Last updated
If you're looking for information on how to set up a basic cutscene with Cinemachine, and handling the toggling of vehicle functions while transitioning in and out of a cutscene, you'll find it here.
If you have any problems using the steps below, please watch the video above, which demonstrates everything shown here.
First, install the Cinemachine package using Unity's package manager, if it's not installed already.
The next thing you want to do is go to the main camera inside the Vehicle Camera's hierarchy and add a CinemachineBrain component.
The next thing you'll want to do is add a CinemachineVirtualCamera to represent the vehicle camera. Go into the Vehicle Camera's hierarchy in your scene and add a new gameobject as a sibling of the main camera, with zero local position and rotation. You may have to adjust the 'Field of View' and 'Far Clip Plane' settings of the virtual camera to match the camera.
Next, create a new gameobject for your cutscene camera, add a CinemachineVirtualCamera component, set its 'Look At' to the player ship, and set the 'Aim' to 'Hard Look At' (you can customize these settings however you wish, this is just for the example).
Now, as long as the cutscene virtual camera's Priority is higher, simply enabling it will switch to the cutscene camera, and disabling it will switch to the vehicle camera.
When using the Space Combat Kit, when you go into or out of a cutscene, you may want to do things like:
Toggle the cutscene camera on and off
Toggle the controls of the ship
Toggle the HUD
Toggle the rigidbody on/off (for example if you want to animate the ship along a path during the cutscene).
Here is an example script called 'TestCutscene' that will enter or exit a cutscene whenever you press the 'C' button, and handles the tasks listed above. Just add it anywhere in your scene to see how it works.