Adding and Setting Collision Layers in Unity
Last updated
Last updated
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.
In the editing interface, enter the name of the layer you want to add, such as "Wall".
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".
After adding the collider, set the layer of the entire asset that has the added collider to the "Wall" layer.