Skip to content

findNearestHero

findNearestHero(world, position): NearestHero | null

Defined in: packages/engine/src/gameplay/behaviours/systems.ts:39

The hero closest to position, or null on a world without one. ponytail: a scan of every hero per caller; a spatial index when a room holds enough of both to feel it.

Parameter Type
world World
position Vector3

NearestHero | null