Skip to content

pickEntity

pickEntity(world, raycaster): Entity | null

Defined in: packages/engine/src/gameplay/entity/pick.ts:11

The entity under raycaster, or null where it meets none: the nearest hit among every entity’s object, walked up to the entity that owns it, passing through an entity the devtools hid. The devtools set the raycaster from the canvas’s pointer and the mounted camera. On a pointer event, not a step, so the arrays here are fine.

Parameter Type
world World
raycaster Raycaster

Entity | null