five-on-it / packages/ai/src/steer-foot / planOnFoot
Function: planOnFoot()
planOnFoot(
ai,npc,x,z,goalX,goalZ,goalFeet?):void
Defined in: packages/ai/src/steer-foot.ts:145
Plans the walk to (goalX, goalZ) on the foot layers when the current plan is missing, due, or aimed too far from the goal, and the world's plans for this tick are not spent (a denied plan is asked for again next tick); keeps the current plan otherwise, and never plans while the character is on a link (a ladder, a lift, in the air). It starts on the floor the character stands on and ends on the floor goalFeet says (the height of the feet of whoever it goes after), or, without it, the floor of the goal's cell nearest the character's own height: up the stairs only when the goal is up there. A profile that climbs plans over the navigation's links too (climbGraph). A goal whose floor it cannot reach costs no search: the plan goes to wayDown instead and is marked unreachable. A complete plan ends at the goal itself; an incomplete one at the node nearest to it.
Parameters
ai
npc
x
number
z
number
goalX
number
goalZ
number
goalFeet?
number
Returns
void