Layers In Unity

Introduction

This article demonstrates how to add layers in your Unity project.

Prerequisites

  • Unity Environment version 5.6.1

Once again, refer to my previous article to get started. 

Add Layers in your project

First, you have to open the Unity project. Create terrain, trees and water. Add the FPS control and create PIP Map Effect in Unity.

 

Click on the "Map camera". The camera preview will be displayed.

 

Click on the FPS controller and select the sphere. The camera preview will be displayed the sphere position. Go to the inspector window click on the layers we are currently using so layers can be displayed.

 

Click on the default button and select the add Layers.

 

The adding layers options will be displayed. First 0 to 7 layers are default. Click on the user Layer8.

 

Give the name of user layer8 is Map layer and press enter key.

 

Now the map layer can be added into the Layers option.

 

Go to the inspector window and select "default". Click on the map layer. Default is changed into map layer.

 

Select the First person controller and go to the inspector window. Select the culling mask.



Click on the culling mask and deselect the map layer. It will be changed into “mixed”.

 

Now click on the Map camera. Go to the inspector window select the culling mask and deselect the Map layer.

 

The culling mask option can be changed into mixed. The camera preview doesn’t display the sphere.

 

Again, select the "map layer" the sphere can be displayed.

 

Summary

I hope, you understood how to add layers in your Unity project.