format
typescript
Physics.RaycastAll(ray, maxDistance, mask, cast_trigger)class: Physics
description
Performs a raycast and returns all the hit objects.
This method shoots a virtual ray in the scene to check if it intersects with any objects, and stores the intersection information with all the objects.
parameter
| param_name | type | description |
|---|---|---|
| ray | Ray | The ray object to be shot. |
| maxDistance | number | The maximum distance the ray can be cast. |
| mask | number | The layers to perform collision detection on (bitwise operation). |
| cast_trigger | QueryTriggerInteraction? | Whether the ray should perform collision detection with triggers. |
return
| type | description |
|---|---|
RaycastHit|undefined | Whether the ray intersects with any objects. If there is no intersection, undefined is returned. |
