# maxDepth

> Sets the contact filter to filter the results to only include Collider2D with a Z coordinate (depth) less than this value.

## Definition

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

```csharp
public float maxDepth
```

### Remarks

This is only used if [\_useDepth](/engine/6000.7/script-reference/unityengine/contactfilter2d/usedepth.md) is true.  If the `maxDepth` is set to -[Mathf.Infinity](/engine/6000.7/script-reference/unityengine/mathf/infinity.md) or [Mathf.Infinity](/engine/6000.7/script-reference/unityengine/mathf/infinity.md) then the highest possible depth is used.

Additional Resources: [Transform](/engine/6000.7/script-reference/unityengine/transform.md)
