NavigationAgent3D
A 3D agent used to pathfind to a position while avoiding obstacles.
A 3D agent used to pathfind to a position while avoiding obstacles.
A 3D agent used to pathfind to a position while avoiding static and dynamic obstacles. The calculation can be used by the parent node to dynamically move it along the path. Requires navigation data to work correctly.
Dynamic obstacles are avoided using RVO collision avoidance. Avoidance is computed before physics, so the pathfinding information can be used safely in the physics step.
Note: After setting the NavigationAgent3D.TargetPosition property, the NavigationAgent3D.GetNextPathPosition method must be used once every physics frame to update the internal path logic of the navigation agent. The vector position it returns should be used as the next movement position for the agent's parent node.
Note: Several methods of this class, such as NavigationAgent3D.GetNextPathPosition, can trigger a new path calculation. Calling these in your callback to an agent's signal, such as NavigationAgent3D.WaypointReached, can cause infinite recursion. It is recommended to call these methods in the physics step or, alternatively, delay their call until the end of the frame (see ReckfellObject.CallDeferred or ReckfellObject.ConnectFlags.Deferred).
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
NavigationAgent3DConstructor
public NavigationAgent3D();Properties33
AvoidanceEnabledProperty
public bool AvoidanceEnabled { get; set; }If true the agent is registered for an RVO avoidance callback on the NavigationServer3D. When NavigationAgent3D.Velocity is set and the processing is completed a safe_velocity Vector3 is received with a signal connection to NavigationAgent3D.VelocityComputed. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
AvoidanceLayersProperty
public uint AvoidanceLayers { get; set; }A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a matching bit on the NavigationAgent3D.AvoidanceMask will avoid this agent.
AvoidanceMaskProperty
public uint AvoidanceMask { get; set; }A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their NavigationAgent3D.AvoidanceLayers.
AvoidancePriorityProperty
public float AvoidancePriority { get; set; }The agent does not adjust the velocity for other agents that would match the NavigationAgent3D.AvoidanceMask but have a lower NavigationAgent3D.AvoidancePriority. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent.
DebugEnabledProperty
public bool DebugEnabled { get; set; }If true shows debug visuals for this agent.
DebugPathCustomColorProperty
public Color DebugPathCustomColor { get; set; }If NavigationAgent3D.DebugUseCustom is true uses this color for this agent instead of global color.
DebugPathCustomPointSizeProperty
public float DebugPathCustomPointSize { get; set; }If NavigationAgent3D.DebugUseCustom is true uses this rasterized point size for rendering path points for this agent instead of global point size.
DebugUseCustomProperty
public bool DebugUseCustom { get; set; }If true uses the defined NavigationAgent3D.DebugPathCustomColor for this agent instead of global color.
HeightProperty
public float Height { get; set; }The height of the avoidance agent. Agents will ignore other agents or obstacles that are above or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses radius spheres alone.
KeepYVelocityProperty
public bool KeepYVelocity { get; set; }If true, and the agent uses 2D avoidance, it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help to soften the most obvious clipping on uneven 3D geometry.
MaxNeighborsProperty
public int MaxNeighbors { get; set; }The maximum number of neighbors for the agent to consider.
MaxSpeedProperty
public float MaxSpeed { get; set; }The maximum speed that an agent can move.
NavigationLayersProperty
public uint NavigationLayers { get; set; }A bitfield determining which navigation layers of navigation regions this agent will use to calculate a path. Changing it during runtime will clear the current navigation path and generate a new one, according to the new navigation layers.
NeighborDistanceProperty
public float NeighborDistance { get; set; }The distance to search for other agents.
PathDesiredDistanceProperty
public float PathDesiredDistance { get; set; }Tolerance for approaching the next point. Align scale, speed and body-origin height with the path surface; too small a value can prevent waypoint progression.
PathHeightOffsetProperty
public float PathHeightOffset { get; set; }Offset subtracted on Y from points returned by GetNextPathPosition and GetFinalPosition. Setting 1 lowered the checked endpoint by 1. Does not change a physics collider or rebake geometry.
PathMaxDistanceProperty
public float PathMaxDistance { get; set; }The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
PathMetadataFlagsProperty
public NavigationPathQueryParameters3D.PathMetadataFlags PathMetadataFlags { get; set; }Additional information to return with the navigation path.
PathPostprocessingProperty
public NavigationPathQueryParameters3D.PathPostProcessing PathPostprocessing { get; set; }The path postprocessing applied to the raw path corridor found by the NavigationAgent3D.PathfindingAlgorithm.
PathReturnMaxLengthProperty
public float PathReturnMaxLength { get; set; }The maximum allowed length of the returned path in world units. A path will be clipped when going over this length.
PathReturnMaxRadiusProperty
public float PathReturnMaxRadius { get; set; }The maximum allowed radius in world units that the returned path can be from the path start. The path will be clipped when going over this radius. Compared to NavigationAgent3D.PathReturnMaxLength, this allows the agent to go that much further, if they need to walk around a corner.
Note: This will perform a sphere clip considering only the actual navigation mesh path points with the first path position being the sphere's center.
PathSearchMaxDistanceProperty
public float PathSearchMaxDistance { get; set; }The maximum distance a searched polygon can be away from the start polygon before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest to the target position so far. A value of 0 or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
PathSearchMaxPolygonsProperty
public int PathSearchMaxPolygons { get; set; }The maximum number of polygons that are searched before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest to the target position so far. A value of 0 or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
PathfindingAlgorithmProperty
public NavigationPathQueryParameters3D.PathfindingAlgorithmEnum PathfindingAlgorithm { get; set; }The pathfinding algorithm used in the path query.
RadiusProperty
public float Radius { get; set; }The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by NavigationAgent3D.NeighborDistance).
Does not affect normal pathfinding. To change an actor's pathfinding radius bake NavigationMesh resources with a different NavigationMesh.AgentRadius property and use different navigation maps for each actor size.
SimplifyEpsilonProperty
public float SimplifyEpsilon { get; set; }The path simplification amount in world units.
SimplifyPathProperty
public bool SimplifyPath { get; set; }If true a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by NavigationAgent3D.SimplifyEpsilon. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation.
Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields".
TargetDesiredDistanceProperty
public float TargetDesiredDistance { get; set; }Tolerance for reaching the original goal. The distance check is three-dimensional: body-origin vertical offset matters too.
TargetPositionProperty
public Vector3 TargetPosition { get; set; }Global 3D agent goal. Assignment requests a new path even for the same position; avoid repeating it every frame without a reason. The agent does not move the body itself.
TimeHorizonAgentsProperty
public float TimeHorizonAgents { get; set; }The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agent movement considerably. Must be positive.
TimeHorizonObstaclesProperty
public float TimeHorizonObstacles { get; set; }The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agent movement considerably. Must be positive.
Use3DAvoidanceProperty
public bool Use3DAvoidance { get; set; }If true, the agent calculates avoidance velocities in 3D omnidirectionally, e.g. for games that take place in air, underwater or space. Agents using 3D avoidance only avoid other agents using 3D avoidance, and react to radius-based avoidance obstacles. They ignore any vertex-based obstacles.
If false, the agent calculates avoidance velocities in 2D along the x and z-axes, ignoring the y-axis. Agents using 2D avoidance only avoid other agents using 2D avoidance, and react to radius-based avoidance obstacles or vertex-based avoidance obstacles. Other agents using 2D avoidance that are below or above their current position including NavigationAgent3D.Height are ignored.
VelocityProperty
public Vector3 Velocity { get; set; }Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use NavigationAgent3D.SetVelocityForced as well to reset the internal simulation velocity.
Methods86
DistanceToTargetfloat
public float DistanceToTarget();Returns the distance to the target position, using the agent's global position. The user must set NavigationAgent3D.TargetPosition in order for this to be accurate.
floatGetAvoidanceEnabledbool
public bool GetAvoidanceEnabled();boolGetAvoidanceLayerValuebool
public bool GetAvoidanceLayerValue(int layerNumber);Returns whether or not the specified layer of the NavigationAgent3D.AvoidanceLayers bitmask is enabled, given a layer_number between 1 and 32.
| Name | Type | Default |
|---|---|---|
layerNumber | int | — |
boolGetAvoidanceLayersuint
public uint GetAvoidanceLayers();uintGetAvoidanceMaskuint
public uint GetAvoidanceMask();uintGetAvoidanceMaskValuebool
public bool GetAvoidanceMaskValue(int maskNumber);Returns whether or not the specified mask of the NavigationAgent3D.AvoidanceMask bitmask is enabled, given a mask_number between 1 and 32.
| Name | Type | Default |
|---|---|---|
maskNumber | int | — |
boolGetAvoidancePriorityfloat
public float GetAvoidancePriority();floatGetCurrentNavigationPathVector3[]
public Vector3[] GetCurrentNavigationPath();Reads current path points rather than moving the parent. A complete physics example checks map geometry and the floor separately.
Vector3[]Vector3[] of the current result. Check Length before accessing endpoints.
GetCurrentNavigationPathIndexint
public int GetCurrentNavigationPathIndex();Returns which index the agent is currently on in the navigation path's Vector3[].
intGetCurrentNavigationResultNavigationPathQueryResult3D
public NavigationPathQueryResult3D GetCurrentNavigationResult();Returns the path query result for the path the agent is currently following.
NavigationPathQueryResult3DGetDebugEnabledbool
public bool GetDebugEnabled();boolGetDebugPathCustomColorColor
public Color GetDebugPathCustomColor();ColorGetDebugPathCustomPointSizefloat
public float GetDebugPathCustomPointSize();floatGetDebugUseCustombool
public bool GetDebugUseCustom();boolGetFinalPositionVector3
public Vector3 GetFinalPosition();Updates navigation and reads the current path endpoint. An unreachable goal can leave it at an accessible boundary.
Vector3Last point with PathHeightOffset subtracted on Y, or Vector3.Zero for an empty result. Check path existence separately.
GetHeightfloat
public float GetHeight();floatGetKeepYVelocitybool
public bool GetKeepYVelocity();boolGetMaxNeighborsint
public int GetMaxNeighbors();intGetMaxSpeedfloat
public float GetMaxSpeed();floatGetNavigationLayerValuebool
public bool GetNavigationLayerValue(int layerNumber);Returns whether or not the specified layer of the NavigationAgent3D.NavigationLayers bitmask is enabled, given a layer_number between 1 and 32.
| Name | Type | Default |
|---|---|---|
layerNumber | int | — |
boolGetNavigationLayersuint
public uint GetNavigationLayers();uintGetNavigationMapRid
public Rid GetNavigationMap();Reads the assigned agent map, or its valid parent world map without an explicit assignment. Does not establish polygon readiness.
RidSelected map RID; may be zero without an assignment and suitable parent.
GetNeighborDistancefloat
public float GetNeighborDistance();floatGetNextPathPositionVector3
public Vector3 GetNextPathPosition();Updates navigation and returns the next point for your movement code. Use in the physics loop while the route is unfinished; this does not command body movement.
Vector3Global point adjusted by PathHeightOffset; an empty path with a valid parent returns the parent position.
GetPathDesiredDistancefloat
public float GetPathDesiredDistance();floatGetPathHeightOffsetfloat
public float GetPathHeightOffset();floatGetPathLengthfloat
public float GetPathLength();Returns the length of the currently calculated path. The returned value is 0.0, if the path is still calculating or no calculation has been requested yet.
floatGetPathMaxDistancefloat
public float GetPathMaxDistance();floatGetPathMetadataFlagsNavigationPathQueryParameters3D.PathMetadataFlags
public NavigationPathQueryParameters3D.PathMetadataFlags GetPathMetadataFlags();NavigationPathQueryParameters3D.PathMetadataFlagsGetPathPostprocessingNavigationPathQueryParameters3D.PathPostProcessing
public NavigationPathQueryParameters3D.PathPostProcessing GetPathPostprocessing();NavigationPathQueryParameters3D.PathPostProcessingGetPathReturnMaxLengthfloat
public float GetPathReturnMaxLength();floatGetPathReturnMaxRadiusfloat
public float GetPathReturnMaxRadius();floatGetPathSearchMaxDistancefloat
public float GetPathSearchMaxDistance();floatGetPathSearchMaxPolygonsint
public int GetPathSearchMaxPolygons();intGetPathfindingAlgorithmNavigationPathQueryParameters3D.PathfindingAlgorithmEnum
public NavigationPathQueryParameters3D.PathfindingAlgorithmEnum GetPathfindingAlgorithm();NavigationPathQueryParameters3D.PathfindingAlgorithmEnumGetRadiusfloat
public float GetRadius();floatGetRidRid
public Rid GetRid();Returns the Rid of this agent on the NavigationServer3D.
RidGetSimplifyEpsilonfloat
public float GetSimplifyEpsilon();floatGetSimplifyPathbool
public bool GetSimplifyPath();boolGetTargetDesiredDistancefloat
public float GetTargetDesiredDistance();floatGetTargetPositionVector3
public Vector3 GetTargetPosition();Vector3GetTimeHorizonAgentsfloat
public float GetTimeHorizonAgents();floatGetTimeHorizonObstaclesfloat
public float GetTimeHorizonObstacles();floatGetUse3DAvoidancebool
public bool GetUse3DAvoidance();boolGetVelocityVector3
public Vector3 GetVelocity();Vector3IsNavigationFinishedbool
public bool IsNavigationFinished();Updates state and checks current-route completion. This differs from reaching the original goal: the checked partial route finished without IsTargetReached.
booltrue when the current route finished, including at a partial-path endpoint.
IsTargetReachablebool
public bool IsTargetReachable();Updates navigation and compares its endpoint with the goal using TargetDesiredDistance. Does not check physical passage through walls.
boolEndpoint-to-goal comparison result; use alongside checking the current path.
IsTargetReachedbool
public bool IsTargetReached();Reads the stored original-goal arrival state. Path-following updates set it using TargetDesiredDistance.
booltrue for a marked arrival at the original goal; a partial-path endpoint may leave it false.
SetAvoidanceEnabledvoid
public void SetAvoidanceEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetAvoidanceLayerValuevoid
public void SetAvoidanceLayerValue(int layerNumber, bool value);Based on value, enables or disables the specified layer in the NavigationAgent3D.AvoidanceLayers bitmask, given a layer_number between 1 and 32.
| Name | Type | Default |
|---|---|---|
layerNumber | int | — |
value | bool | — |
SetAvoidanceLayersvoid
public void SetAvoidanceLayers(uint layers);| Name | Type | Default |
|---|---|---|
layers | uint | — |
SetAvoidanceMaskvoid
public void SetAvoidanceMask(uint mask);| Name | Type | Default |
|---|---|---|
mask | uint | — |
SetAvoidanceMaskValuevoid
public void SetAvoidanceMaskValue(int maskNumber, bool value);Based on value, enables or disables the specified mask in the NavigationAgent3D.AvoidanceMask bitmask, given a mask_number between 1 and 32.
| Name | Type | Default |
|---|---|---|
maskNumber | int | — |
value | bool | — |
SetAvoidancePriorityvoid
public void SetAvoidancePriority(float priority);| Name | Type | Default |
|---|---|---|
priority | float | — |
SetDebugEnabledvoid
public void SetDebugEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetDebugPathCustomColorvoid
public void SetDebugPathCustomColor(Color color);| Name | Type | Default |
|---|---|---|
color | Color | — |
SetDebugPathCustomPointSizevoid
public void SetDebugPathCustomPointSize(float pointSize);| Name | Type | Default |
|---|---|---|
pointSize | float | — |
SetDebugUseCustomvoid
public void SetDebugUseCustom(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetHeightvoid
public void SetHeight(float height);| Name | Type | Default |
|---|---|---|
height | float | — |
SetKeepYVelocityvoid
public void SetKeepYVelocity(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetMaxNeighborsvoid
public void SetMaxNeighbors(int maxNeighbors);| Name | Type | Default |
|---|---|---|
maxNeighbors | int | — |
SetMaxSpeedvoid
public void SetMaxSpeed(float maxSpeed);| Name | Type | Default |
|---|---|---|
maxSpeed | float | — |
SetNavigationLayerValuevoid
public void SetNavigationLayerValue(int layerNumber, bool value);Based on value, enables or disables the specified layer in the NavigationAgent3D.NavigationLayers bitmask, given a layer_number between 1 and 32.
| Name | Type | Default |
|---|---|---|
layerNumber | int | — |
value | bool | — |
SetNavigationLayersvoid
public void SetNavigationLayers(uint navigationLayers);| Name | Type | Default |
|---|---|---|
navigationLayers | uint | — |
SetNavigationMapvoid
public void SetNavigationMap(Rid navigationMap);Sets the Entity explicit query map and submits assignment for the server agent. Requests a new route with an active goal; wait for the server change to be processed.
| Name | Type | Default |
|---|---|---|
navigationMap | Rid | — |
navigationMapRID of a live 3D map with the intended geometry. Do not pass a 2D map or freed RID.
SetNeighborDistancevoid
public void SetNeighborDistance(float neighborDistance);| Name | Type | Default |
|---|---|---|
neighborDistance | float | — |
SetPathDesiredDistancevoid
public void SetPathDesiredDistance(float desiredDistance);| Name | Type | Default |
|---|---|---|
desiredDistance | float | — |
SetPathHeightOffsetvoid
public void SetPathHeightOffset(float pathHeightOffset);| Name | Type | Default |
|---|---|---|
pathHeightOffset | float | — |
SetPathMaxDistancevoid
public void SetPathMaxDistance(float maxSpeed);| Name | Type | Default |
|---|---|---|
maxSpeed | float | — |
SetPathMetadataFlagsvoid
public void SetPathMetadataFlags(NavigationPathQueryParameters3D.PathMetadataFlags flags);| Name | Type | Default |
|---|---|---|
flags | NavigationPathQueryParameters3D.PathMetadataFlags | — |
SetPathPostprocessingvoid
public void SetPathPostprocessing(NavigationPathQueryParameters3D.PathPostProcessing pathPostprocessing);| Name | Type | Default |
|---|---|---|
pathPostprocessing | NavigationPathQueryParameters3D.PathPostProcessing | — |
SetPathReturnMaxLengthvoid
public void SetPathReturnMaxLength(float length);| Name | Type | Default |
|---|---|---|
length | float | — |
SetPathReturnMaxRadiusvoid
public void SetPathReturnMaxRadius(float radius);| Name | Type | Default |
|---|---|---|
radius | float | — |
SetPathSearchMaxDistancevoid
public void SetPathSearchMaxDistance(float distance);| Name | Type | Default |
|---|---|---|
distance | float | — |
SetPathSearchMaxPolygonsvoid
public void SetPathSearchMaxPolygons(int maxPolygons);| Name | Type | Default |
|---|---|---|
maxPolygons | int | — |
SetPathfindingAlgorithmvoid
public void SetPathfindingAlgorithm(NavigationPathQueryParameters3D.PathfindingAlgorithmEnum pathfindingAlgorithm);| Name | Type | Default |
|---|---|---|
pathfindingAlgorithm | NavigationPathQueryParameters3D.PathfindingAlgorithmEnum | — |
SetRadiusvoid
public void SetRadius(float radius);| Name | Type | Default |
|---|---|---|
radius | float | — |
SetSimplifyEpsilonvoid
public void SetSimplifyEpsilon(float epsilon);| Name | Type | Default |
|---|---|---|
epsilon | float | — |
SetSimplifyPathvoid
public void SetSimplifyPath(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetTargetDesiredDistancevoid
public void SetTargetDesiredDistance(float desiredDistance);| Name | Type | Default |
|---|---|---|
desiredDistance | float | — |
SetTargetPositionvoid
public void SetTargetPosition(Vector3 position);| Name | Type | Default |
|---|---|---|
position | Vector3 | — |
SetTimeHorizonAgentsvoid
public void SetTimeHorizonAgents(float timeHorizon);| Name | Type | Default |
|---|---|---|
timeHorizon | float | — |
SetTimeHorizonObstaclesvoid
public void SetTimeHorizonObstacles(float timeHorizon);| Name | Type | Default |
|---|---|---|
timeHorizon | float | — |
SetUse3DAvoidancevoid
public void SetUse3DAvoidance(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetVelocityvoid
public void SetVelocity(Vector3 velocity);| Name | Type | Default |
|---|---|---|
velocity | Vector3 | — |
SetVelocityForcedvoid
public void SetVelocityForced(Vector3 velocity);Replaces the internal velocity in the collision avoidance simulation with NavigationAgent3D.Velocity. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck.
| Name | Type | Default |
|---|---|---|
velocity | Vector3 | — |
Signals and events6
LinkReachedEvent
public event NavigationAgent3D.LinkReachedEventHandler LinkReached;Signals that the agent reached a navigation link. Emitted when the agent moves within NavigationAgent3D.PathDesiredDistance of the next position of the path when that position is a navigation link.
The details dictionary may contain the following keys depending on the value of NavigationAgent3D.PathMetadataFlags:
position: The start position of the link that was reached.type: AlwaysNavigationPathQueryResult3D.PathSegmentType.Link.rid: TheRidof the link.owner: The object which manages the link (usuallyNavigationLink3D).link_entry_position: Ifowneris available and the owner is aNavigationLink3D, it will contain the global position of the link's point the agent is entering.link_exit_position: Ifowneris available and the owner is aNavigationLink3D, it will contain the global position of the link's point which the agent is exiting.
| Name | Type | Default |
|---|---|---|
details | Reckfell.Collections.Dictionary | — |
NavigationFinishedEvent
public event Action NavigationFinished;Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path.
This signal will be emitted just after NavigationAgent3D.TargetReached when the target is reachable.
PathChangedEvent
public event Action PathChanged;Emitted when the agent had to update the loaded path:
- because path was previously empty.
- because navigation map has changed.
- because agent pushed further away from the current path segment than the
NavigationAgent3D.PathMaxDistance.
TargetReachedEvent
public event Action TargetReached;Signals that the agent reached the target, i.e. the agent moved within NavigationAgent3D.TargetDesiredDistance of the NavigationAgent3D.TargetPosition. This signal is emitted only once per loaded path.
This signal will be emitted just before NavigationAgent3D.NavigationFinished when the target is reachable.
It may not always be possible to reach the target but it should always be possible to reach the final position. See NavigationAgent3D.GetFinalPosition.
VelocityComputedEvent
public event NavigationAgent3D.VelocityComputedEventHandler VelocityComputed;Notifies when the collision avoidance velocity is calculated. Emitted every update as long as NavigationAgent3D.AvoidanceEnabled is true and the agent has a navigation map.
| Name | Type | Default |
|---|---|---|
safeVelocity | Vector3 | — |
WaypointReachedEvent
public event NavigationAgent3D.WaypointReachedEventHandler WaypointReached;Signals that the agent reached a waypoint. Emitted when the agent moves within NavigationAgent3D.PathDesiredDistance of the next position of the path.
The details dictionary may contain the following keys depending on the value of NavigationAgent3D.PathMetadataFlags:
position: The position of the waypoint that was reached.type: The type of navigation primitive (region or link) that contains this waypoint.rid: TheRidof the containing navigation primitive (region or link).owner: The object which manages the containing navigation primitive (region or link).
| Name | Type | Default |
|---|---|---|
details | Reckfell.Collections.Dictionary | — |