# SetLayerCollisionMask(int, int)

> Set the collision layer mask that indicates which layer(s) the specified layer can collide with.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public static void SetLayerCollisionMask(int layer, int layerMask)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The layer to set the collision layer mask for.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A mask where each bit indicates a layer and whether it can collide with `layer` or not.

### Remarks

Additional Resources: [Physics2D.GetLayerCollisionMask](/engine/6000.7/script-reference/unityengine/physics2d/getlayercollisionmask.md), [Physics2D.IgnoreLayerCollision](/engine/6000.7/script-reference/unityengine/physics2d/ignorelayercollision.md)
