five-on-it / packages/ai/src/steer-foot / followPath
Function: followPath()
followPath(
ai,npc,x,z,goalX,goalZ,running):object
Defined in: packages/ai/src/steer-foot.ts:90
The unit heading along the current path from (x, z): waypoints within the lookahead are passed, 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 it asks for a new plan and heads straight too.
Parameters
ai
npc
x
number
z
number
goalX
number
goalZ
number
running
boolean
Returns
object
arrived
arrived:
boolean
dx
dx:
number
dz
dz:
number