Creating an in-game surveillance camera

Although using a second viewport can be useful in many situations, there will be times when you need to output the image rendered from a camera to a texture at runtime. To illustrate this point, in this recipe, we will make use of Render Texture to create an in-game surveillance camera that transmits its video to a monitor.

Creating an in-game surveillance camera

In-game surveillance cameras

Getting ready

For this recipe, we have prepared the BasicScene Unity package, containing a scene named BasicScene, and also two FBX 3D models for the monitor and camera objects. The package is in the 1362_05_codes folder, and the 3D models are in the 1362_05_06 ...

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.