Chapter 5. Using Cameras

In this chapter, we will cover:

  • Creating a picture-in-picture effect
  • Switching between multiple cameras
  • Making textures from screen content
  • Zooming a telescopic camera
  • Displaying a mini-map
  • Creating an in-game surveillance camera

Introduction

As developers, we should never forget to pay attention to the cameras. After all, they are the windows through which our players see our games. In this chapter, we will take a look at interesting ways of using cameras that enhance the player's experience.

The big picture

Cameras can be customized in many ways:

  • They can exclude objects on specific layers from rendering
  • They can be set to render in Orthographic mode (that is, without perspective)
  • They can have their Field of View (FOV) manipulated to simulate a wide angle lens
  • They can be rendered on top of other cameras or within specific areas of the screen
  • They can be rendered onto Textures

The list goes on.

The big picture

Two simultaneous camera views

Note that throughout this chapter you will notice that some recipes feature a camera rig that follows the player's third-person character. That rig is the Multipurpose Camera Rig, originally available from Unity's sample assets, which can be imported into your projects by navigating to Assets | Import Package | Camera. To make things easier, we organized the MultipurposeCamera Unity Package containing it as a prefab, which can be found in the 1362_05_codes folder.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.150.142