Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

castRayAll

castRayAll(source, options): readonly RayHitResult[]

Every collider a ray meets within maxDistance, nearest first, and two as near by the lower entity id; one hit per collider, so an entity of two colliders the ray passes through is listed twice. An empty list where it meets none. Pooled, as castRay’s result is.

Parameter Type
source QuerySource
options CastRayOptions

readonly RayHitResult[]

for (const hit of castRayAll(step, { from, direction, maxDistance: 50 })) pierce(hit.entity);