Skip to content

five-on-it / packages/ai/src/perception / nearestVisiblePlayer

Function: nearestVisiblePlayer() ​

nearestVisiblePlayer(sim, npc, p): number

Defined in: packages/ai/src/perception.ts:103

The nearest player character npc sees, or −1; the lower id wins a tie.

Parameters ​

sim ​

SimWorld

npc ​

number

p ​

BehaviourProfile

Returns ​

number