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

overlapShape

overlapShape(source, options): readonly OverlapResult[]

Each entity whose colliders shape overlaps where it stands now, once however many of its colliders it overlaps, in order of entity id: a sword’s arc, a blast’s reach, a goal mouth. Touching counts. It samples the shape where it is, so an arc that must hit all it swept through overlaps at several poses along the swing, or casts its blade with castShape. An empty list where it overlaps none. Pooled, as castRay’s result is.

Parameter Type
source QuerySource
options OverlapShapeOptions

readonly OverlapResult[]

for (const struck of overlapShape(step, { shape: box({ size: [1.6, 0.4, 1.2] }), position: tip, rotation: swing })) strike(struck.entity);