Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


OverlapBoxNonAlloc(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 7 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public static int OverlapBoxNonAlloc(Vector3 center, Vector3 halfExtents, Collider[] results, Quaternion orientation, int mask, QueryTriggerInteraction queryTriggerInteraction)

Parameters

center

Center of the box.

halfExtents

Half of the size of the box in each dimension.

results

The buffer to store the results in.

orientation

Rotation of the box.

mask


queryTriggerInteraction

Specifies whether this query should hit Triggers.

Returns

Type

Description

intThe amount of colliders stored in
results
.