[Unity] Prevent any object from being seen by any camera.


When there are multiple cameras on the screen, there may be cases where certain objects appear on one camera but not on another. In some cases, this is the case.

So today I will show you how to set this up.

First, prepare multiple cameras.


You will have a white cube and a red cube on both cameras.
This time, we want to set the red cube so that it does not appear on one of the cameras.

Select a layer with any name for the red cube’s Layer. You can add a layer with “add layer”.


Next, uncheck the layers that you do not want to be shown in the camera’s Culling Mask.
In this case, uncheck “Mask”.

The red cube with the “Mask” layer is no longer visible to one of the cameras.