Skip to content

1681-engine / index / nearestTarget

Function: nearestTarget() ​

ts
function nearestTarget(
   from, 
   bodies, 
   range?
): number | null;

Defined in: src/input/TargetLock.ts:57

The nearest body within range (ties to the lower id, so two clients pick alike), or null.

Parameters ​

ParameterTypeDefault value
fromPointundefined
bodiesreadonly LockBody[]undefined
rangenumberLOCK_PICK_RANGE

Returns ​

number | null

Released under the MIT License.