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

findOverlappingTargets

findOverlappingTargets(source, entity, findOverlappingTargetsOptions): readonly Entity[]

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.

Parameter Type
source QuerySource
entity Entity
findOverlappingTargetsOptions FindOverlappingTargetsOptions

readonly Entity[]

for (const character of findOverlappingTargets(step, zone, { radius: 4 })) warm(step, character);