OverlapBox(Vector3, Vector3, Collider[], Quaternion, int, QueryTriggerInteraction)
Find all colliders touching or inside of the given box, and store them into the buffer.
Read time 1 minuteLast updated 9 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
public int OverlapBox(Vector3 center, Vector3 halfExtents, Collider[] results, Quaternion orientation, int layerMask = -5, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
Parameters
Center of the box.
Half of the size of the box in each dimension.
The buffer to store the results in.
Rotation of the box.
A Layer mask that is used to selectively filter which colliders are considered when casting a box.
Specifies whether this query should hit Triggers.
Returns
Type | Description |
|---|---|
| int | The amount of colliders stored in |
Remarks
Additional Resources: Physics.OverlapBoxNonAlloc.