# OverlapBox(Vector3, Vector3, Collider[], Quaternion, int, QueryTriggerInteraction)

> Find all colliders touching or inside of the given box, and store them into the buffer.

## Definition

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

```csharp
public int OverlapBox(Vector3 center, Vector3 halfExtents, Collider[] results, Quaternion orientation, int layerMask = -5, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
```

### Parameters

**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Center of the box.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Half of the size of the box in each dimension.**** (\[Collider\[]]\(/engine/6000.7/script-reference/unityengine/collider)): The buffer to store the results in.**** (\[Quaternion]\(/engine/6000.7/script-reference/unityengine/quaternion)): Rotation of the box.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A [Layer mask](/engine/6000.7/manual/working-with-gameobjects/layers.md) that is used to selectively filter which colliders are considered when casting a box.**** (\[QueryTriggerInteraction]\(/engine/6000.7/script-reference/unityengine/querytriggerinteraction)): Specifies whether this query should hit Triggers.

### Returns

| Type                                                       | Description                                  |
| ---------------------------------------------------------- | -------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The amount of colliders stored in `results`. |

### Remarks

Additional Resources: [Physics.OverlapBoxNonAlloc](/engine/6000.7/script-reference/unityengine/physics/overlapboxnonalloc.md)
