> For the complete documentation index, see [llms.txt](https://metasy.gitbook.io/metasy-guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metasy.gitbook.io/metasy-guides/development-and-creation/adding-and-setting-collision-layers-in-unity.md).

# Adding and Setting Collision Layers in Unity

### Adding Collision Layers <a href="#adding-collision-layers" id="adding-collision-layers"></a>

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.

![](https://metasy.gitbook.io/~gitbook/image?url=https:%2F%2Fkclb4f9u3a.feishu.cn%2Fspace%2Fapi%2Fbox%2Fstream%2Fdownload%2Fasynccode%2F%3Fcode=YWVhYWY4YTQwMzIyYjIyNWMxODlkYjQ5NDBhOTljNTFfWTZzU3o1bURvWFBENUhGNlJaZ2h6WHdjV0luTlI0ZlZfVG9rZW46QlVqU2JEREdEb2lLazR4Y0hEQ2NCaWh1bldoXzE3MDg2NzExMjQ6MTcwODY3NDcyNF9WNA\&width=768\&dpr=4\&quality=100\&sign=4056b4d304e6fb31df7f63066287b07e6ebc2543769b7befc2b866ec8a4563d2)

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

![](https://metasy.gitbook.io/~gitbook/image?url=https:%2F%2F1243745051-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FuGOxT8M7CotWCf7E0xy0%252Fuploads%252FzcyrFeszkd230AcIf5Xm%252Fimage.png%3Falt=media%26token=7d6d6b65-95f9-4aa0-84fd-3a1a66a31591\&width=768\&dpr=4\&quality=100\&sign=1f9d92de9790c71aeefc447086275194c0102a9100ca0000187be23dfdbf13af)

### Adding Colliders <a href="#adding-colliders" id="adding-colliders"></a>

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".

![](https://metasy.gitbook.io/~gitbook/image?url=https:%2F%2Fkclb4f9u3a.feishu.cn%2Fspace%2Fapi%2Fbox%2Fstream%2Fdownload%2Fasynccode%2F%3Fcode=OWM4YjY4OTQ5Mzg4YTY0YzhkYzQwNzA1NGQ4ODQ5NTRfanQwTjd1Vm9Va09IcWtNOHVtRnNrQXJTbDlFWmpnRmJfVG9rZW46TVRZV2JxN0l0b2tQbmx4MVYzbmNDbHhabmZxXzE3MDg2NzExODE6MTcwODY3NDc4MV9WNA\&width=768\&dpr=4\&quality=100\&sign=32026e3f9333e440c35e1cfaf6dc0d95092e4accc419e0ba4ba7978cd55bd26c)

![](https://metasy.gitbook.io/~gitbook/image?url=https:%2F%2F1243745051-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FuGOxT8M7CotWCf7E0xy0%252Fuploads%252FyP99nXbRV3hykKxryXzk%252Fimage.png%3Falt=media%26token=eba3d8bf-2e0d-45d5-bdce-c83b536e124c\&width=768\&dpr=4\&quality=100\&sign=f86fe13b686fc88b8d1bd68c948bc4b3069d5151259a44d6ab3a85887eef0c43)

![](https://metasy.gitbook.io/~gitbook/image?url=https:%2F%2F1243745051-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FuGOxT8M7CotWCf7E0xy0%252Fuploads%252FUacB5BeUnQ5M2b4d5cAU%252Fimage.png%3Falt=media%26token=bde01102-d2a8-4438-98a2-6b8554fe52cc\&width=768\&dpr=4\&quality=100\&sign=a6857ab73708cd4f75a13eff22bd5a9874c645f06e082ee9cad432f8dffe7267)

### Setting Collision Layers <a href="#setting-collision-layers" id="setting-collision-layers"></a>

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