Skip to content

five-on-it / packages/ai/src/steer-foot / followPath

Function: followPath() ​

followPath(ai, npc, x, z, goalX, goalZ, running): FootStep

Defined in: packages/ai/src/steer-foot.ts:218

The unit heading along the current path from (x, z): waypoints within the lookahead are passed (one before a link within the link's reach; one reached by a link only once the link is taken, steer-climb.ts), the walk is over within reach of the last one. Without a path (a plan not yet granted) it heads straight for the goal; at the end of an incomplete path (a spent budget) it heads straight too until its next plan, on its schedule; at the end of an unreachable one it stands.

Parameters ​

ai ​

AiWorld

npc ​

NpcState

x ​

number

z ​

number

goalX ​

number

goalZ ​

number

running ​

boolean

Returns ​

FootStep