# SetDepth(float, float)

> Sets the _minDepth and _maxDepth filter properties and turns on depth filtering by setting _useDepth to true.

## Definition

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

```csharp
public void SetDepth(float minDepth, float maxDepth)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The value used to set [\_minDepth](/engine/6000.7/script-reference/unityengine/contactfilter2d/mindepth.md).**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The value used to set [\_maxDepth](/engine/6000.7/script-reference/unityengine/contactfilter2d/maxdepth.md).
