Adding and Setting Collision Layers in Unity

Adding Collision Layers

1. After opening Unity, click on "Layers" in the top right corner to expand the options, and then click on "Edit Layers" in the options to enter the editing interface.

  1. In the editing interface, enter the name of the layer you want to add, such as "Wall".

Adding Colliders

Double-click to open the asset that you need to add a collider to, select the child object that needs a collider, and in the Inspector, click "Add Component" to search for and add either "Mesh Collider" or "Box Collider".

Setting Collision Layers

After adding the collider, set the layer of the entire asset that has the added collider to the "Wall" layer.

Last updated