Navigator
Owns a Types.Pathfinder and a Types.Mover. MoveTo is safe to call every tick with a
moving target: the navigator re-plans on a cadence, re-plans when the target moves, retries when
the mover gets stuck, and reports through GetStatus and Arrived. Every Agent built with
both a pathfinder and a mover has one at agent.Navigator.
A path to a target that stays put is followed to its end by default. Two options change that
for a level that moves under the agent (doors, moving platforms, other NPCs): a pathfinder
with a Blocked signal (Navmesh has one) makes the navigator re-plan on the next cadence
tick, and MaxPathAge plans again once the current path is that many seconds old, whether or
not anything is known to have changed. Both cost one plan each time; neither plans more often
than RepathInterval.
Arrival is judged by horizontal distance within ArriveDistance, with the height difference
allowed up to ArriveHeight: a humanoid's root and a floor waypoint sit at different heights,
but a target on the floor above is not reached.
A step whose Label has a handler (see Builder:OnStep) is where the navigator does the one
thing a mover cannot: it stops at the step, reports Interacting, runs the handler, and then
walks the rest of the path. MoveTo with the same target keeps waiting; a new target or Stop
abandons the path and the handler's return is ignored.
With a direct pathfinder (Builder:UseDirect) the navigator walks straight at a target it can
reach in a line and only plans when it cannot, or when walking straight stopped making
progress. IsDirect says which it is doing.
Functions
new
Navigator.new(