Creating a picture-in-picture effect

Having more than one viewport displayed can be useful in many situations. For example, you may want to show simultaneous events going on in different locations, or you may want to have a separate window for hot-seat multiplayer games. Although you can do this manually by adjusting the Normalized Viewport Rect parameters on your camera, this recipe includes a series of extra preferences to make it more independent from the user's display configuration.

Getting ready

For this recipe, we have prepared the BasicScene Unity package, containing a scene named BasicScene. The package is in the 1362_05_codes folder.

How to do it...

To create a picture-in-picture display, just follow these steps:

  1. Import the BasicScene package ...

Get Unity 5.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.