Letting the player switch to a Cinemachine FreeLook camera
It's always good to give players choices and control in their game experience. In this recipe, we'll set up a mouse-controllable Cinemachine FreeLook camera and let the player switch to it.
Getting ready
This recipe adds to the previous one, so make a copy of that project folder and do your work for this recipe with that copy.
How to do it...
To explore Cinemachine, just follow these steps:
- Ensure the Default Blend property of the Cinemachine Brain component in the Main Camera is set to Ease In Out. This means we'll have a smooth transition when switching between cameras.
- Add a Cinemachine FreeLook camera GameObject to the scene (menu: Cinemachine | Ceate FreeLook Camera). You should see a new GameObject in the Hierarchy named
CM FreeLook 1
. Set the Priority property of the CinemachineFree Look (Script) component to zero. - Locate the
mixamorig:neck
GameObject in the Hierarchy inside MsLazer. We'll use this part of the MsLazer character to...