Game Development Reference
In-Depth Information
Engage thrusters
To start building the level, first we need to add new tags and layers. So, let's get on with it:
1. Let's go to
Edit
|
Project Settings
|
Tags and Layers
to bring up the
Tags and
Layers
inspector view and set it as follows:
Tags
Size
5
Element 0
Ground
Element 1
RestartButton
Element 2
Key
Element 3
Door
Layers
User Layer 8
Player
User Layer 9
Ground
Tags make it easy to find the object, we need
GameOb-
ject.FindWithTag("TagName")
or
gameObject.tag
. More details on
tags can be found at
http://docs.unity3d.com/Documentation/Components/
Note
Layers are used to determine which object will be rendered or used for raycasting.
Sometimes, we can use layers to separate the objects to be rendered. For example,
we could have two cameras and set the first camera to render only the foreground
objects and then another camera to render only the background object (such as, UI,
or minimap). More details on layers can be found at
http://docs.unity3d.com/Docu-