reckfellENGINE

NavigationAgent3D

A 3D agent used to pathfind to a position while avoiding obstacles.

On this page
class NavigationAgent3DReckfellSharpInherits Entity

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
# NavigationAgent3D
C#
public NavigationAgent3D();

Properties33

AvoidanceEnabledProperty
# AvoidanceEnabled
C#
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
# AvoidanceLayers
C#
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
# AvoidanceMask
C#
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
# AvoidancePriority
C#
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
# DebugEnabled
C#
public bool DebugEnabled { get; set; }

If true shows debug visuals for this agent.

DebugPathCustomColorProperty
# DebugPathCustomColor
C#
public Color DebugPathCustomColor { get; set; }

If NavigationAgent3D.DebugUseCustom is true uses this color for this agent instead of global color.

DebugPathCustomPointSizeProperty
# DebugPathCustomPointSize
C#
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
# DebugUseCustom
C#
public bool DebugUseCustom { get; set; }

If true uses the defined NavigationAgent3D.DebugPathCustomColor for this agent instead of global color.

HeightProperty
# Height
C#
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
# KeepYVelocity
C#
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
# MaxNeighbors
C#
public int MaxNeighbors { get; set; }

The maximum number of neighbors for the agent to consider.

MaxSpeedProperty
# MaxSpeed
C#
public float MaxSpeed { get; set; }

The maximum speed that an agent can move.

NavigationLayersProperty
# NavigationLayers
C#
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
# NeighborDistance
C#
public float NeighborDistance { get; set; }

The distance to search for other agents.

PathDesiredDistanceProperty
# PathDesiredDistance
C#
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
# PathHeightOffset
C#
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
# PathMaxDistance
C#
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
# PathMetadataFlags
C#
public NavigationPathQueryParameters3D.PathMetadataFlags PathMetadataFlags { get; set; }

Additional information to return with the navigation path.

PathPostprocessingProperty
# PathPostprocessing
C#
public NavigationPathQueryParameters3D.PathPostProcessing PathPostprocessing { get; set; }

The path postprocessing applied to the raw path corridor found by the NavigationAgent3D.PathfindingAlgorithm.

PathReturnMaxLengthProperty
# PathReturnMaxLength
C#
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
# PathReturnMaxRadius
C#
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
# PathSearchMaxDistance
C#
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
# PathSearchMaxPolygons
C#
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
# PathfindingAlgorithm
C#
public NavigationPathQueryParameters3D.PathfindingAlgorithmEnum PathfindingAlgorithm { get; set; }

The pathfinding algorithm used in the path query.

RadiusProperty
# Radius
C#
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
# SimplifyEpsilon
C#
public float SimplifyEpsilon { get; set; }

The path simplification amount in world units.

SimplifyPathProperty
# SimplifyPath
C#
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
# TargetDesiredDistance
C#
public float TargetDesiredDistance { get; set; }

Tolerance for reaching the original goal. The distance check is three-dimensional: body-origin vertical offset matters too.

TargetPositionProperty
# TargetPosition
C#
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
# TimeHorizonAgents
C#
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
# TimeHorizonObstacles
C#
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
# Use3DAvoidance
C#
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
# Velocity
C#
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
# DistanceToTarget
C#
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.

Returns float
GetAvoidanceEnabledbool
# GetAvoidanceEnabled
C#
public bool GetAvoidanceEnabled();
Returns bool
GetAvoidanceLayerValuebool
# GetAvoidanceLayerValue
C#
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.

Parameters
NameTypeDefault
layerNumberint—
Returns bool
GetAvoidanceLayersuint
# GetAvoidanceLayers
C#
public uint GetAvoidanceLayers();
Returns uint
GetAvoidanceMaskuint
# GetAvoidanceMask
C#
public uint GetAvoidanceMask();
Returns uint
GetAvoidanceMaskValuebool
# GetAvoidanceMaskValue
C#
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.

Parameters
NameTypeDefault
maskNumberint—
Returns bool
GetAvoidancePriorityfloat
# GetAvoidancePriority
C#
public float GetAvoidancePriority();
Returns float
GetCurrentNavigationPathVector3[]
# GetCurrentNavigationPath
C#
public Vector3[] GetCurrentNavigationPath();

Reads current path points rather than moving the parent. A complete physics example checks map geometry and the floor separately.

Returns Vector3[]

Vector3[] of the current result. Check Length before accessing endpoints.

GetCurrentNavigationPathIndexint
# GetCurrentNavigationPathIndex
C#
public int GetCurrentNavigationPathIndex();

Returns which index the agent is currently on in the navigation path's Vector3[].

Returns int
GetCurrentNavigationResultNavigationPathQueryResult3D
# GetCurrentNavigationResult
C#
public NavigationPathQueryResult3D GetCurrentNavigationResult();

Returns the path query result for the path the agent is currently following.

Returns NavigationPathQueryResult3D
GetDebugEnabledbool
# GetDebugEnabled
C#
public bool GetDebugEnabled();
Returns bool
GetDebugPathCustomColorColor
# GetDebugPathCustomColor
C#
public Color GetDebugPathCustomColor();
Returns Color
GetDebugPathCustomPointSizefloat
# GetDebugPathCustomPointSize
C#
public float GetDebugPathCustomPointSize();
Returns float
GetDebugUseCustombool
# GetDebugUseCustom
C#
public bool GetDebugUseCustom();
Returns bool
GetFinalPositionVector3
# GetFinalPosition
C#
public Vector3 GetFinalPosition();

Updates navigation and reads the current path endpoint. An unreachable goal can leave it at an accessible boundary.

Returns Vector3

Last point with PathHeightOffset subtracted on Y, or Vector3.Zero for an empty result. Check path existence separately.

GetHeightfloat
# GetHeight
C#
public float GetHeight();
Returns float
GetKeepYVelocitybool
# GetKeepYVelocity
C#
public bool GetKeepYVelocity();
Returns bool
GetMaxNeighborsint
# GetMaxNeighbors
C#
public int GetMaxNeighbors();
Returns int
GetMaxSpeedfloat
# GetMaxSpeed
C#
public float GetMaxSpeed();
Returns float
GetNavigationLayerValuebool
# GetNavigationLayerValue
C#
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.

Parameters
NameTypeDefault
layerNumberint—
Returns bool
GetNavigationLayersuint
# GetNavigationLayers
C#
public uint GetNavigationLayers();
Returns uint
GetNavigationMapRid
# GetNavigationMap
C#
public Rid GetNavigationMap();

Reads the assigned agent map, or its valid parent world map without an explicit assignment. Does not establish polygon readiness.

Returns Rid

Selected map RID; may be zero without an assignment and suitable parent.

GetNeighborDistancefloat
# GetNeighborDistance
C#
public float GetNeighborDistance();
Returns float
GetNextPathPositionVector3
# GetNextPathPosition
C#
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.

Returns Vector3

Global point adjusted by PathHeightOffset; an empty path with a valid parent returns the parent position.

GetPathDesiredDistancefloat
# GetPathDesiredDistance
C#
public float GetPathDesiredDistance();
Returns float
GetPathHeightOffsetfloat
# GetPathHeightOffset
C#
public float GetPathHeightOffset();
Returns float
GetPathLengthfloat
# GetPathLength
C#
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.

Returns float
GetPathMaxDistancefloat
# GetPathMaxDistance
C#
public float GetPathMaxDistance();
Returns float
GetPathMetadataFlagsNavigationPathQueryParameters3D.PathMetadataFlags
# GetPathMetadataFlags
C#
public NavigationPathQueryParameters3D.PathMetadataFlags GetPathMetadataFlags();
Returns NavigationPathQueryParameters3D.PathMetadataFlags
GetPathPostprocessingNavigationPathQueryParameters3D.PathPostProcessing
# GetPathPostprocessing
C#
public NavigationPathQueryParameters3D.PathPostProcessing GetPathPostprocessing();
Returns NavigationPathQueryParameters3D.PathPostProcessing
GetPathReturnMaxLengthfloat
# GetPathReturnMaxLength
C#
public float GetPathReturnMaxLength();
Returns float
GetPathReturnMaxRadiusfloat
# GetPathReturnMaxRadius
C#
public float GetPathReturnMaxRadius();
Returns float
GetPathSearchMaxDistancefloat
# GetPathSearchMaxDistance
C#
public float GetPathSearchMaxDistance();
Returns float
GetPathSearchMaxPolygonsint
# GetPathSearchMaxPolygons
C#
public int GetPathSearchMaxPolygons();
Returns int
GetPathfindingAlgorithmNavigationPathQueryParameters3D.PathfindingAlgorithmEnum
# GetPathfindingAlgorithm
C#
public NavigationPathQueryParameters3D.PathfindingAlgorithmEnum GetPathfindingAlgorithm();
Returns NavigationPathQueryParameters3D.PathfindingAlgorithmEnum
GetRadiusfloat
# GetRadius
C#
public float GetRadius();
Returns float
GetRidRid
# GetRid
C#
public Rid GetRid();

Returns the Rid of this agent on the NavigationServer3D.

Returns Rid
GetSimplifyEpsilonfloat
# GetSimplifyEpsilon
C#
public float GetSimplifyEpsilon();
Returns float
GetSimplifyPathbool
# GetSimplifyPath
C#
public bool GetSimplifyPath();
Returns bool
GetTargetDesiredDistancefloat
# GetTargetDesiredDistance
C#
public float GetTargetDesiredDistance();
Returns float
GetTargetPositionVector3
# GetTargetPosition
C#
public Vector3 GetTargetPosition();
Returns Vector3
GetTimeHorizonAgentsfloat
# GetTimeHorizonAgents
C#
public float GetTimeHorizonAgents();
Returns float
GetTimeHorizonObstaclesfloat
# GetTimeHorizonObstacles
C#
public float GetTimeHorizonObstacles();
Returns float
GetUse3DAvoidancebool
# GetUse3DAvoidance
C#
public bool GetUse3DAvoidance();
Returns bool
GetVelocityVector3
# GetVelocity
C#
public Vector3 GetVelocity();
Returns Vector3
IsNavigationFinishedbool
# IsNavigationFinished
C#
public bool IsNavigationFinished();

Updates state and checks current-route completion. This differs from reaching the original goal: the checked partial route finished without IsTargetReached.

Returns bool

true when the current route finished, including at a partial-path endpoint.

IsTargetReachablebool
# IsTargetReachable
C#
public bool IsTargetReachable();

Updates navigation and compares its endpoint with the goal using TargetDesiredDistance. Does not check physical passage through walls.

Returns bool

Endpoint-to-goal comparison result; use alongside checking the current path.

IsTargetReachedbool
# IsTargetReached
C#
public bool IsTargetReached();

Reads the stored original-goal arrival state. Path-following updates set it using TargetDesiredDistance.

Returns bool

true for a marked arrival at the original goal; a partial-path endpoint may leave it false.

SetAvoidanceEnabledvoid
# SetAvoidanceEnabled
C#
public void SetAvoidanceEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetAvoidanceLayerValuevoid
# SetAvoidanceLayerValue
C#
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.

Parameters
NameTypeDefault
layerNumberint—
valuebool—
SetAvoidanceLayersvoid
# SetAvoidanceLayers
C#
public void SetAvoidanceLayers(uint layers);
Parameters
NameTypeDefault
layersuint—
SetAvoidanceMaskvoid
# SetAvoidanceMask
C#
public void SetAvoidanceMask(uint mask);
Parameters
NameTypeDefault
maskuint—
SetAvoidanceMaskValuevoid
# SetAvoidanceMaskValue
C#
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.

Parameters
NameTypeDefault
maskNumberint—
valuebool—
SetAvoidancePriorityvoid
# SetAvoidancePriority
C#
public void SetAvoidancePriority(float priority);
Parameters
NameTypeDefault
priorityfloat—
SetDebugEnabledvoid
# SetDebugEnabled
C#
public void SetDebugEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetDebugPathCustomColorvoid
# SetDebugPathCustomColor
C#
public void SetDebugPathCustomColor(Color color);
Parameters
NameTypeDefault
colorColor—
SetDebugPathCustomPointSizevoid
# SetDebugPathCustomPointSize
C#
public void SetDebugPathCustomPointSize(float pointSize);
Parameters
NameTypeDefault
pointSizefloat—
SetDebugUseCustomvoid
# SetDebugUseCustom
C#
public void SetDebugUseCustom(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetHeightvoid
# SetHeight
C#
public void SetHeight(float height);
Parameters
NameTypeDefault
heightfloat—
SetKeepYVelocityvoid
# SetKeepYVelocity
C#
public void SetKeepYVelocity(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetMaxNeighborsvoid
# SetMaxNeighbors
C#
public void SetMaxNeighbors(int maxNeighbors);
Parameters
NameTypeDefault
maxNeighborsint—
SetMaxSpeedvoid
# SetMaxSpeed
C#
public void SetMaxSpeed(float maxSpeed);
Parameters
NameTypeDefault
maxSpeedfloat—
SetNavigationLayerValuevoid
# SetNavigationLayerValue
C#
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.

Parameters
NameTypeDefault
layerNumberint—
valuebool—
SetNavigationLayersvoid
# SetNavigationLayers
C#
public void SetNavigationLayers(uint navigationLayers);
Parameters
NameTypeDefault
navigationLayersuint—
SetNavigationMapvoid
# SetNavigationMap
C#
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.

Parameters
NameTypeDefault
navigationMapRid—
navigationMap

RID of a live 3D map with the intended geometry. Do not pass a 2D map or freed RID.

SetNeighborDistancevoid
# SetNeighborDistance
C#
public void SetNeighborDistance(float neighborDistance);
Parameters
NameTypeDefault
neighborDistancefloat—
SetPathDesiredDistancevoid
# SetPathDesiredDistance
C#
public void SetPathDesiredDistance(float desiredDistance);
Parameters
NameTypeDefault
desiredDistancefloat—
SetPathHeightOffsetvoid
# SetPathHeightOffset
C#
public void SetPathHeightOffset(float pathHeightOffset);
Parameters
NameTypeDefault
pathHeightOffsetfloat—
SetPathMaxDistancevoid
# SetPathMaxDistance
C#
public void SetPathMaxDistance(float maxSpeed);
Parameters
NameTypeDefault
maxSpeedfloat—
SetPathMetadataFlagsvoid
# SetPathMetadataFlags
C#
public void SetPathMetadataFlags(NavigationPathQueryParameters3D.PathMetadataFlags flags);
Parameters
NameTypeDefault
flagsNavigationPathQueryParameters3D.PathMetadataFlags—
SetPathPostprocessingvoid
# SetPathPostprocessing
C#
public void SetPathPostprocessing(NavigationPathQueryParameters3D.PathPostProcessing pathPostprocessing);
Parameters
NameTypeDefault
pathPostprocessingNavigationPathQueryParameters3D.PathPostProcessing—
SetPathReturnMaxLengthvoid
# SetPathReturnMaxLength
C#
public void SetPathReturnMaxLength(float length);
Parameters
NameTypeDefault
lengthfloat—
SetPathReturnMaxRadiusvoid
# SetPathReturnMaxRadius
C#
public void SetPathReturnMaxRadius(float radius);
Parameters
NameTypeDefault
radiusfloat—
SetPathSearchMaxDistancevoid
# SetPathSearchMaxDistance
C#
public void SetPathSearchMaxDistance(float distance);
Parameters
NameTypeDefault
distancefloat—
SetPathSearchMaxPolygonsvoid
# SetPathSearchMaxPolygons
C#
public void SetPathSearchMaxPolygons(int maxPolygons);
Parameters
NameTypeDefault
maxPolygonsint—
SetPathfindingAlgorithmvoid
# SetPathfindingAlgorithm
C#
public void SetPathfindingAlgorithm(NavigationPathQueryParameters3D.PathfindingAlgorithmEnum pathfindingAlgorithm);
Parameters
NameTypeDefault
pathfindingAlgorithmNavigationPathQueryParameters3D.PathfindingAlgorithmEnum—
SetRadiusvoid
# SetRadius
C#
public void SetRadius(float radius);
Parameters
NameTypeDefault
radiusfloat—
SetSimplifyEpsilonvoid
# SetSimplifyEpsilon
C#
public void SetSimplifyEpsilon(float epsilon);
Parameters
NameTypeDefault
epsilonfloat—
SetSimplifyPathvoid
# SetSimplifyPath
C#
public void SetSimplifyPath(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetTargetDesiredDistancevoid
# SetTargetDesiredDistance
C#
public void SetTargetDesiredDistance(float desiredDistance);
Parameters
NameTypeDefault
desiredDistancefloat—
SetTargetPositionvoid
# SetTargetPosition
C#
public void SetTargetPosition(Vector3 position);
Parameters
NameTypeDefault
positionVector3—
SetTimeHorizonAgentsvoid
# SetTimeHorizonAgents
C#
public void SetTimeHorizonAgents(float timeHorizon);
Parameters
NameTypeDefault
timeHorizonfloat—
SetTimeHorizonObstaclesvoid
# SetTimeHorizonObstacles
C#
public void SetTimeHorizonObstacles(float timeHorizon);
Parameters
NameTypeDefault
timeHorizonfloat—
SetUse3DAvoidancevoid
# SetUse3DAvoidance
C#
public void SetUse3DAvoidance(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetVelocityvoid
# SetVelocity
C#
public void SetVelocity(Vector3 velocity);
Parameters
NameTypeDefault
velocityVector3—
SetVelocityForcedvoid
# SetVelocityForced
C#
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.

Parameters
NameTypeDefault
velocityVector3—

Signals and events6

LinkReachedEvent
# LinkReached
C#
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: Always NavigationPathQueryResult3D.PathSegmentType.Link.
  • rid: The Rid of the link.
  • owner: The object which manages the link (usually NavigationLink3D).
  • link_entry_position: If owner is available and the owner is a NavigationLink3D, it will contain the global position of the link's point the agent is entering.
  • link_exit_position: If owner is available and the owner is a NavigationLink3D, it will contain the global position of the link's point which the agent is exiting.
Handler parameters
NameTypeDefault
detailsReckfell.Collections.Dictionary—
NavigationFinishedEvent
# NavigationFinished
C#
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
# PathChanged
C#
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
# TargetReached
C#
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
# VelocityComputed
C#
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.

Handler parameters
NameTypeDefault
safeVelocityVector3—
WaypointReachedEvent
# WaypointReached
C#
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: The Rid of the containing navigation primitive (region or link).
  • owner: The object which manages the containing navigation primitive (region or link).
Handler parameters
NameTypeDefault
detailsReckfell.Collections.Dictionary—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.