format
typescript
Physics.BoxCastAll(center, extents, rotation, direction, maxDistance, mask, cast_trigger)class: Physics
description
Performs a boxcast and returns all the hit objects.
This method casts a box-shaped ray in the scene to check for intersections with objects and stores the intersection information with all the objects.
parameter
| param_name | type | description |
|---|---|---|
| center | Vector3 | The center position of the box. |
| extents | Vector3 | The size of the box. |
| rotation | Quaternion | The rotation of the box. |
| direction | Vector3 | The direction in which the box is cast. |
| maxDistance | number | The maximum distance the box is cast. |
| mask | number | The layers to perform collision detection with (bitwise operation). |
| cast_trigger | QueryTriggerInteraction? | Whether to perform collision detection with triggers. |
return
| type | description |
|---|---|
RaycastHit|undefined | Returns a RaycastHit object if the ray intersects with an object, otherwise returns undefined. |
