Unity Layers and Tags for VRChat Worlds
Every GameObject has one Tag and one Layer. A tag identifies a GameObject for scripts. A layer lets cameras, physics queries, collision rules, lights, and other systems include or exclude groups of GameObjects.
They are not folders or visual labels. Changing either value can alter scripts, collisions, interaction rays, mirrors, cameras, and other runtime behaviour.
Identify the system that uses the current tag or layer, then test that system after the change.
- Select the GameObject and note its current Tag and Layer.
- Inspect its scripts, cameras, colliders, prefab status, and parent-child structure.
- Use a custom layer from 22–30 when a VRChat world needs a new filtering group.
- Run the VRChat SDK validation and test the affected collision, raycast, camera, or interaction.
The Worlds SDK configures VRChat's built-in layers automatically. If you rename or remove those layers, or change their collision matrix, VRChat overrides the changes during world upload. Layers 22–30 are available for custom world use and retain their names and collision settings. Avoid layer 31, which Unity uses for editor preview mechanics.
Tag, Layer, and LayerMask
| System | Stored on a GameObject | Purpose | Common consumers |
|---|---|---|---|
| Tag | One tag | Identify what a GameObject represents | Scripts, trigger checks, object searches |
| Layer | One numbered layer | Place a GameObject in a filtering group | Cameras, lights, physics, raycasts, collision rules |
| LayerMask | One or more selected layers | Tell a component or API which layers to include or exclude | Camera Culling Mask, raycasts, Udon fields, Scene Descriptor options |
A layer number and a LayerMask are not interchangeable. A layer is one index. A LayerMask is a bitmask where each enabled bit represents an included layer.
Use Tags for Script Identity
Tags are reference words used to identify GameObjects in scripts. Several objects can share a tag, but each GameObject can have only one.
Examples include a script that:
- Finds the GameObject tagged
MainCamera. - Checks a trigger collider with
CompareTag. - Finds one GameObject assigned a project-specific tag.
Do not assume a tag changes physics or visibility. A tag only matters when a script or editor system explicitly reads it.
Create and assign a tag
- Select a GameObject.
- Open the Tag dropdown at the top of the Inspector.
- Select Add Tag to open Tags and Layers settings.
- Add the new tag.
- Return to the GameObject and select the tag from its Tag dropdown.
Unity 2022.3 does not let you rename a tag after creating it. Choose the spelling carefully and search the project for script references before deleting an existing tag.
Use Layers for Filtering
Layers separate GameObjects into numbered groups. Unity systems can then include or exclude those groups.
| System | Layer-based setting | Result |
|---|---|---|
| Camera | Culling Mask | Selects which layers the camera renders |
| Physics raycast | LayerMask argument | Selects which collider layers can be hit |
| Physics settings | Layer Collision Matrix | Selects which layer pairs can collide |
| Light | Culling Mask where supported | Selects which layers receive the light |
| VRChat Scene Descriptor | Interact Passthrough | Selects user layers that do not block interaction rays |
A layer does nothing by itself. The behaviour comes from the camera, physics setting, script, or VRChat system that reads it.
Create and Assign a Unity Layer
In a normal Unity project:
- Select a GameObject.
- Open the Layer dropdown at the top of the Inspector.
- Select Add Layer.
- Enter a clear name in an available user-layer slot.
- Return to the GameObject and select the new layer.
You can also open Edit > Project Settings > Tags and Layers.
When assigning a layer to a parent, Unity may ask whether to change its children. Choose carefully. Renderers, colliders, interaction surfaces, or helper objects below the parent may intentionally use different layers.
For a VRChat world, use layers 22–30 for new project-specific layers unless the official VRChat layer table documents a different intended layer for the exact feature.
Current VRChat World Layers
These are the layers most world creators need to recognize. Consult the official VRChat table before using any layer not listed here.
| Layer | Name | World-creator guidance |
|---|---|---|
| 0 | Default | Default Unity objects; also used by VRChat Avatar Pedestals |
| 2 | IgnoreRaycast | Ignored by Unity physics raycasts without a mask, but not by VRChat physics raycasts |
| 3 | Item | Used for VRChat items placed by users; world GameObjects on this layer are moved to Default on upload |
| 4 | Water | Used by VRChat portals and mirrors, with other common Unity uses |
| 5 | UI | Used by Unity UI; VRChat UI pointers and cameras treat it specially |
| 6–7 | Reserved | Do not use; world GameObjects on reserved layers are moved to Default on upload |
| 8 | Interactive | Available for world use; VRChat recommends it for colliders where stickers should be blocked |
| 9 | Player | Used for players other than the local player |
| 10 | PlayerLocal | Used when rendering the local player |
| 11 | Environment | Available for world use |
| 12 | UiMenu | Treated specially by VRChat interaction pointers |
| 13 | Pickup | Applied to VRChat pickups by default; does not collide with players |
| 14 | PickupNoEnvironment | Colliders on this layer only collide with Pickup |
| 17 | Walkthrough | Colliders do not collide with players |
| 18 | MirrorReflection | Renderers appear only in mirrors; its colliders do not block VRChat raycasts |
| 19–20 | InternalUI, HardwareObjects | Do not use for world content |
| 21 | Reserved | Do not use; world GameObjects on this layer are moved to Default on upload |
| 22–30 | User layers | Safe range for custom names and collision-matrix settings |
| 31 | User layer | Avoid; Unity uses it for editor preview mechanics |
VRChat's layer behaviour is more specific than the layer name alone. For example, Unity's IgnoreRaycast behaviour does not mean VRChat physics raycasts will ignore layer 2.
Configure Layer-Based Collisions
Open Edit > Project Settings > Physics and find the Layer Collision Matrix.
- A checked pair allows colliders on those two layers to interact.
- An unchecked pair prevents collisions between those layers.
- The diagonal controls whether objects on the same layer collide with one another.
Changing the matrix affects all matching colliders, not only the selected GameObject. Test player movement, pickups, rigidbodies, triggers, and Udon logic after changing it.
For VRChat built-in layers, upload processing restores VRChat's expected collision configuration. Restrict custom collision-matrix changes to layers 22–30.
Use LayerMasks Correctly
LayerMask fields often appear as a checklist in the Inspector. Select the layers that a camera, raycast, or script should include.
In code, do not pass a raw layer number where an API expects a LayerMask. For example, layer index 9 and a mask that includes layer 9 are different integer values. Use Unity's LayerMask utilities or a serialized LayerMask field so the intended bits are set correctly.
When a raycast misses or hits the wrong object, inspect:
- Whether the target has a Collider.
- Which GameObject in the hierarchy owns that Collider.
- The Collider GameObject's layer.
- The LayerMask supplied to the query.
- Whether trigger colliders are included.
- Whether a nearer collider blocks the query first.
Camera and Mirror Visibility
A Camera component's Culling Mask selects which layers it renders. Excluding a layer can hide its renderers from that camera without disabling the GameObjects.
This is useful for controlled secondary cameras, but a layer change can also make objects disappear unexpectedly. Check the Culling Mask on the camera that produces the output.
VRChat mirrors use additional VRChat-specific behaviour. Layer 18, MirrorReflection, renders only in mirrors and not in the main VRChat camera. Do not move ordinary world geometry to that layer as a general mirror optimization.
VRChat Interaction Passthrough
Colliders on user layers block VRChat interaction rays by default. The Interact Passthrough LayerMask on the VRC Scene Descriptor identifies user layers that interaction rays may pass through.
Use passthrough only when a collider should not prevent a player from targeting an interactable behind it. Remember that Desktop/Mobile interaction rays and VR hand-based rays originate differently, so test the same surface in the input modes the world supports.
VRChat also recommends validating GameObjects returned by physics operations with Utilities.IsValid before using them in Udon, because protected objects can be returned as null.
Stickers and Collider Layers
VRChat+ users can place stickers on eligible Collider components unless the world disables stickers or the collider uses a layer that does not allow them.
VRChat recommends layer 8, Interactive, for colliders that should block sticker placement while remaining available for world use. Do not change a collider's layer only for stickers without checking collision, raycast, camera, and interaction effects.
Troubleshooting
A camera cannot see an object
Check the layer on the GameObject that owns the Renderer, then inspect the camera's Culling Mask. Also confirm that the Renderer and its parent GameObjects are active.
A raycast misses the intended collider
Check the layer on the Collider's GameObject and the LayerMask used by the query. A raw layer index is not the same as a LayerMask, and VRChat raycasts do not automatically follow Unity's layer-2 IgnoreRaycast rule.
Objects stopped colliding after a layer change
Open Edit > Project Settings > Physics and inspect the Layer Collision Matrix. Also check whether the objects use triggers, rigidbodies, or VRChat layers with predefined collision behaviour.
Changing a parent's layer broke its children
The layer-change prompt may have applied the new layer throughout the hierarchy. Inspect the child GameObjects that own renderers, colliders, cameras, UI, pickups, and interaction components.
A custom layer name or collision rule changed after upload
VRChat restores its built-in layer configuration during upload. Move custom layer names and collision rules to layers 22–30, then update the affected GameObjects and LayerMasks.
An interaction behind a collider cannot be selected
The collider may be blocking VRChat's interaction ray. If it is on a user layer and should be transparent to interaction, review the VRC Scene Descriptor's Interact Passthrough mask and test both desktop and VR interaction.
Before You Finish
- Record the original tag and layer before modifying an imported prefab.
- Use layers 22–30 for new VRChat world filtering groups.
- Avoid layer 31 and VRChat reserved layers.
- Check child GameObjects before applying a layer recursively.
- Review every camera, raycast, collision, and interaction mask that uses the changed layer.
- Run VRChat SDK validation and test the world in the VRChat client.
Continue Learning
- Hierarchy, GameObjects, and Components
- Inspector Basics and Workflows
- Build Settings and VRChat World Testing
- Unity Layers in VRChat
- How to Make Your Own Mirrors in Unity
- Scripts
Official References
- Unity Tags
- Unity Layers
- Unity: Create layers
- Unity Layers and LayerMasks
- Unity Layer-based collision detection
- Unity Camera component
- VRChat Unity Layers
- VRChat VRC Scene Descriptor
Next Step
Select one world object involved in a camera, collision, raycast, or interaction rule. Trace its Collider or Renderer, layer, consuming LayerMask, and collision-matrix entry from end to end.