Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


BoxCastNonAlloc(Vector3, Vector3, Vector3, RaycastHit[], Quaternion, float, int, QueryTriggerInteraction)

Cast the box along the direction, and store hits in the provided buffer.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public static int BoxCastNonAlloc(Vector3 center, Vector3 halfExtents, Vector3 direction, RaycastHit[] results, Quaternion orientation, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction)

Parameters

center

Center of the box.

halfExtents

Half the size of the box in each dimension.

direction

The direction in which to cast the box.

The buffer to store the results in.

orientation

Rotation of the box.

maxDistance

The max length of the cast.

layerMask


queryTriggerInteraction

Specifies whether this query should hit Triggers.

Returns

Type

Description

intThe amount of hits stored to the results buffer.