# SweepTestAll(Vector3, float, QueryTriggerInteraction)

> Like Rigidbody.SweepTest, but returns all hits.

## Definition

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

```csharp
public RaycastHit[] SweepTestAll(Vector3 direction, float maxDistance, QueryTriggerInteraction queryTriggerInteraction)
```

### Parameters

**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): The direction into which to sweep the rigidbody.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The length of the sweep.**** (\[QueryTriggerInteraction]\(/engine/6000.5/script-reference/unityengine/querytriggerinteraction)): Specifies whether this query should hit Triggers.

### Returns

| Type                                                                        | Description                                 |
| --------------------------------------------------------------------------- | ------------------------------------------- |
| [RaycastHit\[\]](/engine/6000.5/script-reference/unityengine/raycasthit.md) | An array of all colliders hit in the sweep. |

### Remarks

The sweep may return multiple hits against the same collider if more then one of the rigidbody's attached colliders would hit it.

Note that this function only works when a primitive collider type (sphere, cube or capsule) or a convex mesh is attached to the rigidbody object - concave mesh colliders will not work, although they can be detected in the Scene by the sweep.

This function can only return up to 128 hits.
