NavigationAgent#
Follows static 3D routes through a CharacterController on the same root. Navigation owns movement only while a route is active.
public sealed class NavigationAgent : ScriptMembers: AfterPhysics · BlockedTimeout · OnAttach · OnDestroy · Path · SetDestination · Speed · State · StateChanged · Stop · StoppingDistance
AfterPhysics#
public override void AfterPhysics(float dt);BlockedTimeout#
[Range(.1f, 10)]
public float BlockedTimeout;Seconds without solved movement before reporting Blocked; 1 by default.
OnAttach#
public override void OnAttach();OnDestroy#
public override void OnDestroy();Path#
public NavigationPath? Path { get; }The last path request result, or null before a request.
SetDestination#
public bool SetDestination(Vector3 destination);Requests one route to a world-space point. False stops the old route and records the failed query in Path.
Speed#
[Range(.1f, 20)]
public float Speed;Walking speed in m/s; 3 by default.
State#
public NavigationAgentState State { get; }The current route state.
StateChanged#
public event Action<NavigationAgentState>? StateChanged;Raised once when the route state changes, including arrival, blockage and cancellation.
Stop#
public void Stop();Cancels the route, clears persistent motor intent and returns movement ownership to project code.
StoppingDistance#
[Range(.02f, 1)]
public float StoppingDistance;Horizontal arrival distance in metres; 0.12 by default.
Related types#
NavigationAgentState · NavigationPath · Script
Source#
- NavigationAgent.cs