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

CastShapeOptions

What castShape takes: the shape, where it starts and how it is turned, the way it moves for so many metres, and the filter.

Property Type Description
bodyTypes? readonly RigidBodyType[] The kinds of body the query meets, every kind where left out: by the kind each body declares, so a page’s stand-in for a ball the room rolls counts as dynamic. A character’s capsule is kinematic.
collisionLayer? CollisionLayerHandle The layer the query stands in, as a body standing there would: it meets only colliders whose own mask holds it, so a monster’s floor ray passes through what monsters pass through. Left out, it stands in every layer, and meets every collider whose mask holds any: one whose mask is empty meets nothing, a query included.
collisionMask? CollisionMask The layers whose colliders the query meets: every layer where left out.
direction Vector3Like Which way it goes, in world space: any length but zero, since the query normalizes it.
from Vector3Like Where the ray starts, in world space. A collider it starts inside is met at distance 0.
ignore? readonly Entity[] Entities whose colliders the query passes through, such as the caster’s own; one destroyed since is passed silently, since it has no collider left to meet.
includeTriggers? boolean Whether the query meets trigger colliders, which it passes through by default, as Unity’s QueryTriggerInteraction does.
maxDistance? number Metres it reaches: without end where left out.
rotation? QuaternionLike How the shape is turned, in world space: upright where left out.
shape QueryShape The shape it sweeps, about its centre.