Layers
Updated
A layer is a group of entities identified by a number. Every entity is on exactly one layer, set by its Layer component. Layers let an author treat a group of objects as one: lock all the props so they cannot be picked by accident while editing, switch off every decoration at once, or make all the glass in a scene let clicks pass through. This section explains which layers exist, what a layer controls, and how a script moves entities between layers.
Before you start
Section titled “Before you start”- You know the common components every entity carries, including Layer, Enable and Lock. See Common components.
- For the raycasting parts, it helps to know what a pointer ray is. See Input and interaction.
Layer values
Section titled “Layer values”| Values | Use |
|---|---|
| 0 to 20 | User layers, for you to use. Every entity starts on layer 0. |
| 21 to 31 | Reserved for the runtime. A Layer component rejects them. |
Layers 1 to 10 always exist, labelled unnamed, unlocked, enabled and raycastable until you change them. Any other user layer, 0 included, can be defined as well.
In this section
Section titled “In this section”| Topic | Description |
|---|---|
| Layer settings | Label, colour, locked, enabled and raycastable, and how each one applies. |
| Layers from a script | Move entities between layers, read an entity’s layer and report layer changes. |
Next steps
Section titled “Next steps”Layer settingsWhat locked, enabled and raycastable do to the entities on a layer.
Layers from a scriptsetLayer, the Layer component and its change event.
Physics layersA separate set of layers that decides which colliders collide.