Curriculum
Course: How to develop 3D Games with Unity
Login
Video lesson

The Camera

In this tutorial, you’ll:

  • Explore the Camera component in Unity
  • Set up a virtual camera using Cinemachine
  • Add a range of different post-processing effects

Once you’ve completed this tutorial, your camera will be set up to make the game as visually interesting for players as possible.

Set up a Virtual Camera using Cinemachine

To set up a virtual camera using Cinemachine:

In the Project window, go to Assets > Scenes and double click MainScene.

1. In the Hierarchy, select the JohnLemon GameObject.

2. Move your cursor over the Scene window and press the F key.

3. In the top menu, go to Cinemachine > Create Virtual Camera.

This will create a new GameObject in the scene called Virtual Camera, rename it to CM vcam1:

This will be created at the focus point of the Scene window’s camera, so it should be right on top of JohnLemon. However, since you now have a virtual camera in the Scene it will have moved the Game window’s view, so you can no longer see JohnLemon in the Game window.

To fix this, you need to make sure the virtual camera is tracking the character by changing the Cinemachine Virtual Camera component settings.

Research Opportunity

The main camera initially is set at the top right side of the game character John Lemon. However, when the virtual camera from the Cinemachine Component is added, we have changed it’s position to point directly above John Lemon. Now, there are other angles that can be explored which is not covered in the tutorial. A separate research video is created to explore camera angles. What if we want to look infront of the character all the time with the view of the floor or just behind the character and little above. Each camera angle is researched with different options for different game modes.

The video is yet to be made, once it is done, it will be in a separate playlist or section with different lessons.