SweepTestAll
7/14/25Less than 1 minute
Rigidbody.SweepTestAll(Vector3 direction, number maxDistance = math.huge, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
Like Rigidbody.SweepTest, but returns all hits.
Parameters:
| Name | Type | Description |
|---|---|---|
| direction | Vector3 | The direction into which to sweep the rigidbody. |
| maxDistance | number | The length of the sweep. |
| queryTriggerInteraction | QueryTriggerInteraction | Specifies whether this query should hit Triggers. |
Returns:
| type | Description |
|---|---|
| RaycastHit[] | An array of all colliders hit in the sweep. |
Usage
---@type Rigidbody
local rigidbody;
---@type Vector3
local direction;
---@type number
local maxDistance;
---@type QueryTriggerInteraction
local queryTriggerInteraction;
local val0 = rigidbody.SweepTestAll(direction, maxDistance, queryTriggerInteraction)
