findOverlappingTargets
findOverlappingTargets(
source,entity,findOverlappingTargetsOptions): readonlyEntity[]
Every target targets names whose body overlaps or touches the sphere
of radius about entity, nearest first by its feet, ties in entity
order: what Pickup, Loot, Interact and Trigger meet. A body is met by
its shape, a capsule, a kart’s colliders or a ball’s sphere, through
the physics scene and the layers the filter’s kinds and layers stand
in; a target with no body in the scene, such as a character in a world
with no terrain or a cursor a player moves, by its capsule or its
point. It samples where each stands now, so a body that crosses the
sphere within one step is not met. The list is refilled by the next
call: copy it to keep it. Pass the step in a system, so the scene meets
what spawned since its last step.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
QuerySource |
entity |
Entity |
findOverlappingTargetsOptions |
FindOverlappingTargetsOptions |
Returns
Section titled “Returns”readonly Entity[]
Example
Section titled “Example”for (const character of findOverlappingTargets(step, zone, { radius: 4 })) warm(step, character);