CAMERA CONFIGURATION
A Camera allows the users or player to view the scene that we develop. Without a Camera in the project, the scene never gets rendered. When we create a new scene, Main Camera GameObject is automatically included. Main Camera includes the Camera component. Thus, we can configure the component, use scripts to manipulate it, like any other game objects.
Transform: Main Camera
The position, rotation and scale of the camera can be manipulated like other game objects. In this game, I am using 3D objects but would like my user to experience it as a 2D game. So to set up 2D screen, I rotated my camera facing downwards to the plane.
Figure 1. Camera Facing Downward
Camera Component
Projection: It is the way that we can setup for the player to view the scene. There are two projection types in Unity Camera:
Perspective: Renders the scene like real world camera. This projection is most widely used in game development.
Orthographic: Objects are viewed in parallel projection using this camera. This is most common in 2D games, puzzles and board games, and so on. This is also useful in rendering the UI elements.
Perspective Projection
Orthographic Projection
Clipping Planes: The clipping planes control the rendering of the scene. We can specify what objects to render and how far the scene is to be rendered. This can be done by adjusting the Near and Far clipping planes of the component.
Field of View: This controls how wide the field will be that our camera can capture.
Note that, the term Field of View will be changed to Size when we use orthographic projection. However, the function is similar.
Clear Flags: This property defines what background should our scene have during the game. The part of the screen that are not rendered in the camera are considered empty in the scene. Hence, clear flags will determine what to show in that empty space.
Skybox: It provides the textured background to the scene.
Solid Color: If this is used, the color selected in the Background property will be shown.
Depth Only: Used when we are using multiple camera in the scene.
Don't Clear: It creates a smear effect and normally not used in the games.
Background: The color value that we set in the Background property will be set as our background behind the objects in the scene.
Culling Mask: It enlists all the layers that are present in the scene. We can select what layers to be rendered by our camera using culling mask.
Camera Component Properties