reckfellENGINE

NavigationServer3D

A server interface for low-level 3D navigation access.

On this page
class NavigationServer3DReckfellSharp

A server interface for low-level 3D navigation access.

NavigationServer3D is the server that handles navigation maps, regions, and agents. It does not handle A* navigation from AStar3D. Maps are divided into regions, which are composed of navigation meshes. Together, they define the navigable areas in the 3D world. Note: Most NavigationServer3D changes take effect after the next physics frame and not immediately. This includes all changes made to maps, regions, or agents by navigation-related nodes in the scene tree or made through scripts. For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than edge_connection_margin to the respective other edge's vertex. You may assign navigation layers to regions with NavigationServer3D.RegionSetNavigationLayers, which then can be checked upon when requesting a path with NavigationServer3D.MapGetPath. This can be used to allow or deny certain areas for some objects. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. Note: The collision avoidance system ignores regions. Using the modified velocity directly may move an agent outside of the traversable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties1

SingletonProperty
# Singleton
C#
public static NavigationServer3DInstance Singleton { get; }

Methods157

AgentCreateRid
# AgentCreate
C#
public static Rid AgentCreate();

Creates the agent.

Returns Rid
AgentGetAvoidanceEnabledbool
# AgentGetAvoidanceEnabled
C#
public static bool AgentGetAvoidanceEnabled(Rid agent);

Returns true if the provided agent has avoidance enabled.

Parameters
NameTypeDefault
agentRid—
Returns bool
AgentGetAvoidanceLayersuint
# AgentGetAvoidanceLayers
C#
public static uint AgentGetAvoidanceLayers(Rid agent);

Returns the avoidance_layers bitmask of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns uint
AgentGetAvoidanceMaskuint
# AgentGetAvoidanceMask
C#
public static uint AgentGetAvoidanceMask(Rid agent);

Returns the avoidance_mask bitmask of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns uint
AgentGetAvoidancePriorityfloat
# AgentGetAvoidancePriority
C#
public static float AgentGetAvoidancePriority(Rid agent);

Returns the avoidance_priority of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns float
AgentGetHeightfloat
# AgentGetHeight
C#
public static float AgentGetHeight(Rid agent);

Returns the height of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns float
AgentGetMapRid
# AgentGetMap
C#
public static Rid AgentGetMap(Rid agent);

Returns the navigation map Rid the requested agent is currently assigned to.

Parameters
NameTypeDefault
agentRid—
Returns Rid
AgentGetMaxNeighborsint
# AgentGetMaxNeighbors
C#
public static int AgentGetMaxNeighbors(Rid agent);

Returns the maximum number of other agents the specified agent takes into account in the navigation.

Parameters
NameTypeDefault
agentRid—
Returns int
AgentGetMaxSpeedfloat
# AgentGetMaxSpeed
C#
public static float AgentGetMaxSpeed(Rid agent);

Returns the maximum speed of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns float
AgentGetNeighborDistancefloat
# AgentGetNeighborDistance
C#
public static float AgentGetNeighborDistance(Rid agent);

Returns the maximum distance to other agents the specified agent takes into account in the navigation.

Parameters
NameTypeDefault
agentRid—
Returns float
AgentGetPausedbool
# AgentGetPaused
C#
public static bool AgentGetPaused(Rid agent);

Returns true if the specified agent is paused.

Parameters
NameTypeDefault
agentRid—
Returns bool
AgentGetPositionVector3
# AgentGetPosition
C#
public static Vector3 AgentGetPosition(Rid agent);

Returns the position of the specified agent in world space.

Parameters
NameTypeDefault
agentRid—
Returns Vector3
AgentGetRadiusfloat
# AgentGetRadius
C#
public static float AgentGetRadius(Rid agent);

Returns the radius of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns float
AgentGetTimeHorizonAgentsfloat
# AgentGetTimeHorizonAgents
C#
public static float AgentGetTimeHorizonAgents(Rid agent);

Returns the minimal amount of time for which the specified agent's velocities that are computed by the simulation are safe with respect to other agents.

Parameters
NameTypeDefault
agentRid—
Returns float
AgentGetTimeHorizonObstaclesfloat
# AgentGetTimeHorizonObstacles
C#
public static float AgentGetTimeHorizonObstacles(Rid agent);

Returns the minimal amount of time for which the specified agent's velocities that are computed by the simulation are safe with respect to static avoidance obstacles.

Parameters
NameTypeDefault
agentRid—
Returns float
AgentGetUse3DAvoidancebool
# AgentGetUse3DAvoidance
C#
public static bool AgentGetUse3DAvoidance(Rid agent);

Returns true if the provided agent uses avoidance in 3D space Vector3(x,y,z) instead of horizontal 2D Vector2(x,y) / Vector3(x,0.0,z).

Parameters
NameTypeDefault
agentRid—
Returns bool
AgentGetVelocityVector3
# AgentGetVelocity
C#
public static Vector3 AgentGetVelocity(Rid agent);

Returns the velocity of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns Vector3
AgentHasAvoidanceCallbackbool
# AgentHasAvoidanceCallback
C#
public static bool AgentHasAvoidanceCallback(Rid agent);

Return true if the specified agent has an avoidance callback.

Parameters
NameTypeDefault
agentRid—
Returns bool
AgentIsMapChangedbool
# AgentIsMapChanged
C#
public static bool AgentIsMapChanged(Rid agent);

Returns true if the map got changed the previous frame.

Parameters
NameTypeDefault
agentRid—
Returns bool
AgentSetAvoidanceCallbackvoid
# AgentSetAvoidanceCallback
C#
public static void AgentSetAvoidanceCallback(Rid agent, Callable callback);

Sets the callback Callable that gets called after each avoidance processing step for the agent. The calculated safe_velocity will be dispatched with a signal to the object just before the physics calculations. Note: Created callbacks are always processed independently of the EntityTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use NavigationServer3D.AgentSetAvoidanceCallback again with an empty Callable.

Parameters
NameTypeDefault
agentRid—
callbackCallable—
AgentSetAvoidanceEnabledvoid
# AgentSetAvoidanceEnabled
C#
public static void AgentSetAvoidanceEnabled(Rid agent, bool enabled);

If enabled is true, the provided agent calculates avoidance.

Parameters
NameTypeDefault
agentRid—
enabledbool—
AgentSetAvoidanceLayersvoid
# AgentSetAvoidanceLayers
C#
public static void AgentSetAvoidanceLayers(Rid agent, uint layers);

Set the agent's avoidance_layers bitmask.

Parameters
NameTypeDefault
agentRid—
layersuint—
AgentSetAvoidanceMaskvoid
# AgentSetAvoidanceMask
C#
public static void AgentSetAvoidanceMask(Rid agent, uint mask);

Set the agent's avoidance_mask bitmask.

Parameters
NameTypeDefault
agentRid—
maskuint—
AgentSetAvoidancePriorityvoid
# AgentSetAvoidancePriority
C#
public static void AgentSetAvoidancePriority(Rid agent, float priority);

Set the agent's avoidance_priority with a priority between 0.0 (lowest priority) to 1.0 (highest priority). The specified agent does not adjust the velocity for other agents that would match the avoidance_mask but have a lower avoidance_priority. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent.

Parameters
NameTypeDefault
agentRid—
priorityfloat—
AgentSetHeightvoid
# AgentSetHeight
C#
public static void AgentSetHeight(Rid agent, float height);

Updates the provided agent height.

Parameters
NameTypeDefault
agentRid—
heightfloat—
AgentSetMapvoid
# AgentSetMap
C#
public static void AgentSetMap(Rid agent, Rid map);

Puts the agent in the map.

Parameters
NameTypeDefault
agentRid—
mapRid—
AgentSetMaxNeighborsvoid
# AgentSetMaxNeighbors
C#
public static void AgentSetMaxNeighbors(Rid agent, int count);

Sets the maximum number of other agents the agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe.

Parameters
NameTypeDefault
agentRid—
countint—
AgentSetMaxSpeedvoid
# AgentSetMaxSpeed
C#
public static void AgentSetMaxSpeed(Rid agent, float maxSpeed);

Sets the maximum speed of the agent. Must be positive.

Parameters
NameTypeDefault
agentRid—
maxSpeedfloat—
AgentSetNeighborDistancevoid
# AgentSetNeighborDistance
C#
public static void AgentSetNeighborDistance(Rid agent, float distance);

Sets the maximum distance to other agents this agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe.

Parameters
NameTypeDefault
agentRid—
distancefloat—
AgentSetPausedvoid
# AgentSetPaused
C#
public static void AgentSetPaused(Rid agent, bool paused);

If paused is true the specified agent will not be processed. For example, it will not calculate avoidance velocities or receive avoidance callbacks.

Parameters
NameTypeDefault
agentRid—
pausedbool—
AgentSetPositionvoid
# AgentSetPosition
C#
public static void AgentSetPosition(Rid agent, Vector3 position);

Sets the position of the agent in world space.

Parameters
NameTypeDefault
agentRid—
positionVector3—
AgentSetRadiusvoid
# AgentSetRadius
C#
public static void AgentSetRadius(Rid agent, float radius);

Sets the radius of the agent.

Parameters
NameTypeDefault
agentRid—
radiusfloat—
AgentSetTimeHorizonAgentsvoid
# AgentSetTimeHorizonAgents
C#
public static void AgentSetTimeHorizonAgents(Rid agent, float timeHorizon);

The minimal amount of time for which the agent's velocities that are computed by the simulation are safe with respect to other agents. The larger this number, the sooner this agent will respond to the presence of other agents, but the less freedom this agent has in choosing its velocities. A too high value will slow down agent movement considerably. Must be positive.

Parameters
NameTypeDefault
agentRid—
timeHorizonfloat—
AgentSetTimeHorizonObstaclesvoid
# AgentSetTimeHorizonObstacles
C#
public static void AgentSetTimeHorizonObstacles(Rid agent, float timeHorizon);

The minimal amount of time for which the agent's velocities that are computed by the simulation are safe with respect to static avoidance obstacles. The larger this number, the sooner this agent will respond to the presence of static avoidance obstacles, but the less freedom this agent has in choosing its velocities. A too high value will slow down agent movement considerably. Must be positive.

Parameters
NameTypeDefault
agentRid—
timeHorizonfloat—
AgentSetUse3DAvoidancevoid
# AgentSetUse3DAvoidance
C#
public static void AgentSetUse3DAvoidance(Rid agent, bool enabled);

Sets if the agent uses the 2D avoidance or the 3D avoidance while avoidance is enabled. If true the agent calculates avoidance velocities in 3D for the XYZ axes, e.g. for games that take place in the air, underwater, or space. The 3D agent only avoids other 3D avoidance agents. The 3D agent only reacts to radius based avoidance obstacles. The 3D agent ignores any vertices based obstacles. The 3D agent only avoids other 3D agents. If false the agent calculates avoidance velocities in 2D along the xz-axes ignoring the y-axis. The 2D agent only avoids other 2D avoidance agents. The 2D agent reacts to radius avoidance obstacles. The 2D agent reacts to vertex based avoidance obstacles. The 2D agent only avoids other 2D agents. 2D agents will ignore other 2D agents or obstacles that are below their current position or above their current position including the agent's height in 2D avoidance.

Parameters
NameTypeDefault
agentRid—
enabledbool—
AgentSetVelocityvoid
# AgentSetVelocity
C#
public static void AgentSetVelocity(Rid agent, Vector3 velocity);

Sets velocity as the new wanted velocity for the specified agent. The avoidance simulation will try to achieve this velocity if possible, but will adjust it to avoid colliding with other agents and obstacles. When an agent is teleported to a new position far away, use NavigationServer3D.AgentSetVelocityForced instead to reset the internal velocity state.

Parameters
NameTypeDefault
agentRid—
velocityVector3—
AgentSetVelocityForcedvoid
# AgentSetVelocityForced
C#
public static void AgentSetVelocityForced(Rid agent, Vector3 velocity);

Replaces the internal velocity in the collision avoidance simulation with velocity for the specified agent. 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
agentRid—
velocityVector3—
BakeFromSourceGeometryDatavoid
# BakeFromSourceGeometryData
C#
public static void BakeFromSourceGeometryData(NavigationMesh navigationMesh, NavigationMeshSourceGeometryData3D sourceGeometryData, Callable callback = default);

Synchronously bakes supplied source data into a navigation resource. Does not automatically parse the entire level or assign output to a region. Check polygon count, assign the resource and wait for map publication.

Parameters
NameTypeDefault
navigationMeshNavigationMesh—
sourceGeometryDataNavigationMeshSourceGeometryData3D—
callbackCallabledefault
navigationMesh

Output resource with configured bake parameters, including radius and resolution. Its contents are modified by the call.

sourceGeometryData

Prepared source data of the corresponding dimension. Empty or unsuitable surfaces may produce no polygons.

BakeFromSourceGeometryDataAsyncvoid
# BakeFromSourceGeometryDataAsync
C#
public static void BakeFromSourceGeometryDataAsync(NavigationMesh navigationMesh, NavigationMeshSourceGeometryData3D sourceGeometryData, Callable callback = default);

Bakes the provided navigation_mesh with the data from the provided source_geometry_data as an async task running on a background thread. After the process is finished the optional callback will be called.

Parameters
NameTypeDefault
navigationMeshNavigationMesh—
sourceGeometryDataNavigationMeshSourceGeometryData3D—
callbackCallabledefault
FreeRidvoid
# FreeRid
C#
public static void FreeRid(Rid rid);

Destroys the given RID.

Parameters
NameTypeDefault
ridRid—
GetDebugEnabledbool
# GetDebugEnabled
C#
public static bool GetDebugEnabled();

Reads the server debug flag. An enabled flag does not prove geometry is visible: the corresponding Entity types provide standard visualization subject to additional settings.

Returns bool

Current flag value; this is not a visualization or path-correctness check.

GetMapsReckfell.Collections.Array<Rid>
# GetMaps
C#
public static Reckfell.Collections.Array<Rid> GetMaps();

Returns all created navigation map Rids on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them.

Returns Reckfell.Collections.Array<Rid>
GetProcessInfoint
# GetProcessInfo
C#
public static int GetProcessInfo(NavigationServer3D.ProcessInfo processInfo);

Reads a 3D server counter. Aggregates cover active maps after server processing, not all allocated RIDs. A disabled region remains in RegionCount while assigned to an active map. This does not measure search time.

Parameters
NameTypeDefault
processInfoNavigationServer3D.ProcessInfo—
processInfo

Counter selection: ActiveMaps, RegionCount, PolygonCount, or another ProcessInfo value.

Returns int

Integer counter value. The latest map changes may still be awaiting processing.

IsBakingNavigationMeshbool
# IsBakingNavigationMesh
C#
public static bool IsBakingNavigationMesh(NavigationMesh navigationMesh);

Returns true when the provided navigation mesh is being baked on a background thread.

Parameters
NameTypeDefault
navigationMeshNavigationMesh—
Returns bool
LinkCreateRid
# LinkCreate
C#
public static Rid LinkCreate();

Create a new link between two positions on a map.

Returns Rid
LinkGetEnabledbool
# LinkGetEnabled
C#
public static bool LinkGetEnabled(Rid link);

Returns true if the specified link is enabled.

Parameters
NameTypeDefault
linkRid—
Returns bool
LinkGetEndPositionVector3
# LinkGetEndPosition
C#
public static Vector3 LinkGetEndPosition(Rid link);

Returns the ending position of this link.

Parameters
NameTypeDefault
linkRid—
Returns Vector3
LinkGetEnterCostfloat
# LinkGetEnterCost
C#
public static float LinkGetEnterCost(Rid link);

Returns the enter cost of this link.

Parameters
NameTypeDefault
linkRid—
Returns float
LinkGetIterationIduint
# LinkGetIterationId
C#
public static uint LinkGetIterationId(Rid link);

Returns the current iteration ID of the navigation link. Every time the navigation link changes and synchronizes, the iteration ID increases. An iteration ID of 0 means the navigation link has never synchronized. Note: The iteration ID will wrap around to 1 after reaching its range limit.

Parameters
NameTypeDefault
linkRid—
Returns uint
LinkGetMapRid
# LinkGetMap
C#
public static Rid LinkGetMap(Rid link);

Returns the navigation map Rid the requested link is currently assigned to.

Parameters
NameTypeDefault
linkRid—
Returns Rid
LinkGetNavigationLayersuint
# LinkGetNavigationLayers
C#
public static uint LinkGetNavigationLayers(Rid link);

Returns the navigation layers for this link.

Parameters
NameTypeDefault
linkRid—
Returns uint
LinkGetOwnerIdulong
# LinkGetOwnerId
C#
public static ulong LinkGetOwnerId(Rid link);

Returns the ObjectID of the object which manages this link.

Parameters
NameTypeDefault
linkRid—
Returns ulong
LinkGetStartPositionVector3
# LinkGetStartPosition
C#
public static Vector3 LinkGetStartPosition(Rid link);

Returns the starting position of this link.

Parameters
NameTypeDefault
linkRid—
Returns Vector3
LinkGetTravelCostfloat
# LinkGetTravelCost
C#
public static float LinkGetTravelCost(Rid link);

Returns the travel cost of this link.

Parameters
NameTypeDefault
linkRid—
Returns float
LinkIsBidirectionalbool
# LinkIsBidirectional
C#
public static bool LinkIsBidirectional(Rid link);

Returns whether this link can be travelled in both directions.

Parameters
NameTypeDefault
linkRid—
Returns bool
LinkSetBidirectionalvoid
# LinkSetBidirectional
C#
public static void LinkSetBidirectional(Rid link, bool bidirectional);

Sets whether this link can be travelled in both directions.

Parameters
NameTypeDefault
linkRid—
bidirectionalbool—
LinkSetEnabledvoid
# LinkSetEnabled
C#
public static void LinkSetEnabled(Rid link, bool enabled);

If enabled is true, the specified link will contribute to its current navigation map.

Parameters
NameTypeDefault
linkRid—
enabledbool—
LinkSetEndPositionvoid
# LinkSetEndPosition
C#
public static void LinkSetEndPosition(Rid link, Vector3 position);

Sets the exit position for the link.

Parameters
NameTypeDefault
linkRid—
positionVector3—
LinkSetEnterCostvoid
# LinkSetEnterCost
C#
public static void LinkSetEnterCost(Rid link, float enterCost);

Sets the enter_cost for this link.

Parameters
NameTypeDefault
linkRid—
enterCostfloat—
LinkSetMapvoid
# LinkSetMap
C#
public static void LinkSetMap(Rid link, Rid map);

Sets the navigation map Rid for the link.

Parameters
NameTypeDefault
linkRid—
mapRid—
LinkSetNavigationLayersvoid
# LinkSetNavigationLayers
C#
public static void LinkSetNavigationLayers(Rid link, uint navigationLayers);

Sets the given link's navigation layers to navigation_layers. This allows selecting links from a path request (when using NavigationServer3D.MapGetPath).

Parameters
NameTypeDefault
linkRid—
navigationLayersuint—
LinkSetOwnerIdvoid
# LinkSetOwnerId
C#
public static void LinkSetOwnerId(Rid link, ulong ownerId);

Set the ObjectID of the object which manages this link.

Parameters
NameTypeDefault
linkRid—
ownerIdulong—
LinkSetStartPositionvoid
# LinkSetStartPosition
C#
public static void LinkSetStartPosition(Rid link, Vector3 position);

Sets the entry position for this link.

Parameters
NameTypeDefault
linkRid—
positionVector3—
LinkSetTravelCostvoid
# LinkSetTravelCost
C#
public static void LinkSetTravelCost(Rid link, float travelCost);

Sets the travel_cost for this link.

Parameters
NameTypeDefault
linkRid—
travelCostfloat—
MapCreateRid
# MapCreate
C#
public static Rid MapCreate();

Creates a separate navigation map without geometry. Its owner must enable processing, add regions, wait for publication and eventually release the map with FreeRid.

Returns Rid

RID of the new map, rather than a region or Entity. Do not substitute an object from another dimension.

MapForceUpdatevoid · Deprecated
# MapForceUpdate
C#
public static void MapForceUpdate(Rid map);

This function immediately forces synchronization of the specified navigation map Rid. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions, and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. Avoidance processing and dispatch of the safe_velocity signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame. Note: With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight.

Parameters
NameTypeDefault
mapRid—
MapGetAgentsReckfell.Collections.Array<Rid>
# MapGetAgents
C#
public static Reckfell.Collections.Array<Rid> MapGetAgents(Rid map);

Returns all navigation agent Rids that are currently assigned to the requested navigation map.

Parameters
NameTypeDefault
mapRid—
Returns Reckfell.Collections.Array<Rid>
MapGetCellHeightfloat
# MapGetCellHeight
C#
public static float MapGetCellHeight(Rid map);

Returns the map cell height used to rasterize the navigation mesh vertices on the Y axis.

Parameters
NameTypeDefault
mapRid—
Returns float
MapGetCellSizefloat
# MapGetCellSize
C#
public static float MapGetCellSize(Rid map);

Returns the map cell size used to rasterize the navigation mesh vertices on the XZ plane.

Parameters
NameTypeDefault
mapRid—
Returns float
MapGetClosestPointVector3
# MapGetClosestPoint
C#
public static Vector3 MapGetClosestPoint(Rid map, Vector3 toPoint);

Returns the navigation mesh surface point closest to the provided to_point on the navigation map.

Parameters
NameTypeDefault
mapRid—
toPointVector3—
Returns Vector3
MapGetClosestPointNormalVector3
# MapGetClosestPointNormal
C#
public static Vector3 MapGetClosestPointNormal(Rid map, Vector3 toPoint);

Returns the navigation mesh surface normal closest to the provided to_point on the navigation map.

Parameters
NameTypeDefault
mapRid—
toPointVector3—
Returns Vector3
MapGetClosestPointOwnerRid
# MapGetClosestPointOwner
C#
public static Rid MapGetClosestPointOwner(Rid map, Vector3 toPoint);

Returns the owner region RID for the navigation mesh surface point closest to the provided to_point on the navigation map.

Parameters
NameTypeDefault
mapRid—
toPointVector3—
Returns Rid
MapGetClosestPointToSegmentVector3
# MapGetClosestPointToSegment
C#
public static Vector3 MapGetClosestPointToSegment(Rid map, Vector3 start, Vector3 end, bool useCollision = false);

Returns the navigation mesh surface point closest to the provided start and end segment on the navigation map. If use_collision is true, a closest point test is only done when the segment intersects with the navigation mesh surface.

Parameters
NameTypeDefault
mapRid—
startVector3—
endVector3—
useCollisionboolfalse
Returns Vector3
MapGetEdgeConnectionMarginfloat
# MapGetEdgeConnectionMargin
C#
public static float MapGetEdgeConnectionMargin(Rid map);

Returns the edge connection margin of the map. This distance is the minimum vertex distance needed to connect two edges from different regions.

Parameters
NameTypeDefault
mapRid—
Returns float
MapGetIterationIduint
# MapGetIterationId
C#
public static uint MapGetIterationId(Rid map);

Returns the current iteration id of the navigation map. Every time the navigation map changes and synchronizes the iteration id increases. An iteration id of 0 means the navigation map has never synchronized. Note: The iteration id will wrap back to 1 after reaching its range limit.

Parameters
NameTypeDefault
mapRid—
Returns uint
MapGetLinkConnectionRadiusfloat
# MapGetLinkConnectionRadius
C#
public static float MapGetLinkConnectionRadius(Rid map);

Returns the link connection radius of the map. This distance is the maximum range any link will search for navigation mesh polygons to connect to.

Parameters
NameTypeDefault
mapRid—
Returns float
MapGetLinksReckfell.Collections.Array<Rid>
# MapGetLinks
C#
public static Reckfell.Collections.Array<Rid> MapGetLinks(Rid map);

Returns all navigation link Rids that are currently assigned to the requested navigation map.

Parameters
NameTypeDefault
mapRid—
Returns Reckfell.Collections.Array<Rid>
MapGetMergeRasterizerCellScalefloat
# MapGetMergeRasterizerCellScale
C#
public static float MapGetMergeRasterizerCellScale(Rid map);

Returns the map's internal merge rasterizer cell scale.

Parameters
NameTypeDefault
mapRid—
Returns float
MapGetObstaclesReckfell.Collections.Array<Rid>
# MapGetObstacles
C#
public static Reckfell.Collections.Array<Rid> MapGetObstacles(Rid map);

Returns all navigation obstacle Rids that are currently assigned to the requested navigation map.

Parameters
NameTypeDefault
mapRid—
Returns Reckfell.Collections.Array<Rid>
MapGetPathVector3[]
# MapGetPath
C#
public static Vector3[] MapGetPath(Rid map, Vector3 origin, Vector3 destination, bool optimize, uint navigationLayers = 1);

Queries path points on a published map. A nonempty result may be partial or have projected start/target positions; check both endpoints. The array neither moves a character nor updates itself after map changes.

Parameters
NameTypeDefault
mapRid—
originVector3—
destinationVector3—
optimizebool—
navigationLayersuint1
map

RID of a live navigation map in this dimension with published geometry.

origin

Start in map-global coordinates; the first result point may be projected onto an accessible surface.

destination

Target in map-global coordinates; the last result point may differ when it is unreachable.

optimize

true uses Corridorfunnel within the found corridor; false uses Edgecentered. Does not disable A* or guarantee less computation.

navigationLayers

Mask of permitted region and link layers; defaults to 1. Layer N is bit 1u << (N - 1).

Returns Vector3[]

Vector3[] route points; empty when no suitable path is returned. Existing points do not guarantee reaching the requested target or physically safe movement.

MapGetRandomPointVector3
# MapGetRandomPoint
C#
public static Vector3 MapGetRandomPoint(Rid map, uint navigationLayers, bool uniformly);

Returns a random position picked from all map region polygons with matching navigation_layers. If uniformly is true, all map regions, polygons, and faces are weighted by their surface area (slower). If uniformly is false, just a random region and a random polygon are picked (faster).

Parameters
NameTypeDefault
mapRid—
navigationLayersuint—
uniformlybool—
Returns Vector3
MapGetRegionsReckfell.Collections.Array<Rid>
# MapGetRegions
C#
public static Reckfell.Collections.Array<Rid> MapGetRegions(Rid map);

Returns all navigation region Rids that are currently assigned to the requested navigation map.

Parameters
NameTypeDefault
mapRid—
Returns Reckfell.Collections.Array<Rid>
MapGetUpVector3
# MapGetUp
C#
public static Vector3 MapGetUp(Rid map);

Returns the map's up direction.

Parameters
NameTypeDefault
mapRid—
Returns Vector3
MapGetUseAsyncIterationsbool
# MapGetUseAsyncIterations
C#
public static bool MapGetUseAsyncIterations(Rid map);

Returns true if the map synchronization uses an async process that runs on a background thread.

Parameters
NameTypeDefault
mapRid—
Returns bool
MapGetUseEdgeConnectionsbool
# MapGetUseEdgeConnections
C#
public static bool MapGetUseEdgeConnections(Rid map);

Returns true if the navigation map allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.

Parameters
NameTypeDefault
mapRid—
Returns bool
MapIsActivebool
# MapIsActive
C#
public static bool MapIsActive(Rid map);

Returns true if the map is active.

Parameters
NameTypeDefault
mapRid—
Returns bool
MapSetActivevoid
# MapSetActive
C#
public static void MapSetActive(Rid map, bool active);

Enables or disables the map participation in server processing. False does not prohibit direct queries against already published navigation, as verified in the installed build. Pause character behavior through game logic.

Parameters
NameTypeDefault
mapRid—
activebool—
map

Map RID belonging to the corresponding NavigationServer.

active

true includes the map in processing; false removes it. This is not a path-query permission flag.

MapSetCellHeightvoid
# MapSetCellHeight
C#
public static void MapSetCellHeight(Rid map, float cellHeight);

Sets the map cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height of the used navigation meshes.

Parameters
NameTypeDefault
mapRid—
cellHeightfloat—
MapSetCellSizevoid
# MapSetCellSize
C#
public static void MapSetCellSize(Rid map, float cellSize);

Sets the map cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size of the used navigation meshes.

Parameters
NameTypeDefault
mapRid—
cellSizefloat—
MapSetEdgeConnectionMarginvoid
# MapSetEdgeConnectionMargin
C#
public static void MapSetEdgeConnectionMargin(Rid map, float margin);

Set the map edge connection margin used to weld the compatible region edges.

Parameters
NameTypeDefault
mapRid—
marginfloat—
MapSetLinkConnectionRadiusvoid
# MapSetLinkConnectionRadius
C#
public static void MapSetLinkConnectionRadius(Rid map, float radius);

Set the map's link connection radius used to connect links to navigation polygons.

Parameters
NameTypeDefault
mapRid—
radiusfloat—
MapSetMergeRasterizerCellScalevoid
# MapSetMergeRasterizerCellScale
C#
public static void MapSetMergeRasterizerCellScale(Rid map, float scale);

Set the map's internal merge rasterizer cell scale used to control merging sensitivity.

Parameters
NameTypeDefault
mapRid—
scalefloat—
MapSetUpvoid
# MapSetUp
C#
public static void MapSetUp(Rid map, Vector3 up);

Sets the map up direction.

Parameters
NameTypeDefault
mapRid—
upVector3—
MapSetUseAsyncIterationsvoid
# MapSetUseAsyncIterations
C#
public static void MapSetUseAsyncIterations(Rid map, bool enabled);

If enabled is true the map synchronization uses an async process that runs on a background thread.

Parameters
NameTypeDefault
mapRid—
enabledbool—
MapSetUseEdgeConnectionsvoid
# MapSetUseEdgeConnections
C#
public static void MapSetUseEdgeConnections(Rid map, bool enabled);

Set the navigation map edge connection use. If enabled is true, the navigation map allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.

Parameters
NameTypeDefault
mapRid—
enabledbool—
ObstacleCreateRid
# ObstacleCreate
C#
public static Rid ObstacleCreate();

Creates a new obstacle.

Returns Rid
ObstacleGetAvoidanceEnabledbool
# ObstacleGetAvoidanceEnabled
C#
public static bool ObstacleGetAvoidanceEnabled(Rid obstacle);

Returns true if the provided obstacle has avoidance enabled.

Parameters
NameTypeDefault
obstacleRid—
Returns bool
ObstacleGetAvoidanceLayersuint
# ObstacleGetAvoidanceLayers
C#
public static uint ObstacleGetAvoidanceLayers(Rid obstacle);

Returns the avoidance_layers bitmask of the specified obstacle.

Parameters
NameTypeDefault
obstacleRid—
Returns uint
ObstacleGetHeightfloat
# ObstacleGetHeight
C#
public static float ObstacleGetHeight(Rid obstacle);

Returns the height of the specified obstacle.

Parameters
NameTypeDefault
obstacleRid—
Returns float
ObstacleGetMapRid
# ObstacleGetMap
C#
public static Rid ObstacleGetMap(Rid obstacle);

Returns the navigation map Rid the requested obstacle is currently assigned to.

Parameters
NameTypeDefault
obstacleRid—
Returns Rid
ObstacleGetPausedbool
# ObstacleGetPaused
C#
public static bool ObstacleGetPaused(Rid obstacle);

Returns true if the specified obstacle is paused.

Parameters
NameTypeDefault
obstacleRid—
Returns bool
ObstacleGetPositionVector3
# ObstacleGetPosition
C#
public static Vector3 ObstacleGetPosition(Rid obstacle);

Returns the position of the specified obstacle in world space.

Parameters
NameTypeDefault
obstacleRid—
Returns Vector3
ObstacleGetRadiusfloat
# ObstacleGetRadius
C#
public static float ObstacleGetRadius(Rid obstacle);

Returns the radius of the specified dynamic obstacle.

Parameters
NameTypeDefault
obstacleRid—
Returns float
ObstacleGetUse3DAvoidancebool
# ObstacleGetUse3DAvoidance
C#
public static bool ObstacleGetUse3DAvoidance(Rid obstacle);

Returns true if the provided obstacle uses avoidance in 3D space Vector3(x,y,z) instead of horizontal 2D Vector2(x,y) / Vector3(x,0.0,z).

Parameters
NameTypeDefault
obstacleRid—
Returns bool
ObstacleGetVelocityVector3
# ObstacleGetVelocity
C#
public static Vector3 ObstacleGetVelocity(Rid obstacle);

Returns the velocity of the specified dynamic obstacle.

Parameters
NameTypeDefault
obstacleRid—
Returns Vector3
ObstacleGetVerticesVector3[]
# ObstacleGetVertices
C#
public static Vector3[] ObstacleGetVertices(Rid obstacle);

Returns the outline vertices for the specified obstacle.

Parameters
NameTypeDefault
obstacleRid—
Returns Vector3[]
ObstacleSetAvoidanceEnabledvoid
# ObstacleSetAvoidanceEnabled
C#
public static void ObstacleSetAvoidanceEnabled(Rid obstacle, bool enabled);

If enabled is true, the provided obstacle affects avoidance using agents.

Parameters
NameTypeDefault
obstacleRid—
enabledbool—
ObstacleSetAvoidanceLayersvoid
# ObstacleSetAvoidanceLayers
C#
public static void ObstacleSetAvoidanceLayers(Rid obstacle, uint layers);

Sets the given obstacle's avoidance layers to layers.

Parameters
NameTypeDefault
obstacleRid—
layersuint—
ObstacleSetHeightvoid
# ObstacleSetHeight
C#
public static void ObstacleSetHeight(Rid obstacle, float height);

Sets the height for the obstacle. In 3D agents will ignore obstacles that are above or below them while using 2D avoidance.

Parameters
NameTypeDefault
obstacleRid—
heightfloat—
ObstacleSetMapvoid
# ObstacleSetMap
C#
public static void ObstacleSetMap(Rid obstacle, Rid map);

Assigns the obstacle to a navigation map.

Parameters
NameTypeDefault
obstacleRid—
mapRid—
ObstacleSetPausedvoid
# ObstacleSetPaused
C#
public static void ObstacleSetPaused(Rid obstacle, bool paused);

If paused is true the specified obstacle will not be processed. For example, it will no longer affect avoidance velocities.

Parameters
NameTypeDefault
obstacleRid—
pausedbool—
ObstacleSetPositionvoid
# ObstacleSetPosition
C#
public static void ObstacleSetPosition(Rid obstacle, Vector3 position);

Updates the position in world space for the obstacle.

Parameters
NameTypeDefault
obstacleRid—
positionVector3—
ObstacleSetRadiusvoid
# ObstacleSetRadius
C#
public static void ObstacleSetRadius(Rid obstacle, float radius);

Sets the radius of the dynamic obstacle.

Parameters
NameTypeDefault
obstacleRid—
radiusfloat—
ObstacleSetUse3DAvoidancevoid
# ObstacleSetUse3DAvoidance
C#
public static void ObstacleSetUse3DAvoidance(Rid obstacle, bool enabled);

Sets if the obstacle uses the 2D avoidance or the 3D avoidance while avoidance is enabled.

Parameters
NameTypeDefault
obstacleRid—
enabledbool—
ObstacleSetVelocityvoid
# ObstacleSetVelocity
C#
public static void ObstacleSetVelocity(Rid obstacle, Vector3 velocity);

Sets velocity of the dynamic obstacle. Allows other agents to better predict the movement of the dynamic obstacle. Only works in combination with the radius of the obstacle.

Parameters
NameTypeDefault
obstacleRid—
velocityVector3—
ObstacleSetVertices2 overloads
# ObstacleSetVertices · 1/2
C#
public static void ObstacleSetVertices(Rid obstacle, Vector3[] vertices);

Sets the outline vertices for the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out.

Parameters
NameTypeDefault
obstacleRid—
verticesVector3[]—
# ObstacleSetVertices · 2/2
C#
public static void ObstacleSetVertices(Rid obstacle, ReadOnlySpan<Vector3> vertices);

Sets the outline vertices for the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out.

Parameters
NameTypeDefault
obstacleRid—
verticesReadOnlySpan<Vector3>—
ParseSourceGeometryDatavoid
# ParseSourceGeometryData
C#
public static void ParseSourceGeometryData(NavigationMesh navigationMesh, NavigationMeshSourceGeometryData3D sourceGeometryData, Entity rootEntity, Callable callback = default);

Parses the EntityTree for source geometry according to the properties of navigation_mesh. Updates the provided source_geometry_data resource with the resulting data. The resource can then be used to bake a navigation mesh with NavigationServer3D.BakeFromSourceGeometryData. After the process is finished the optional callback will be called. Note: This function needs to run on the main thread or with a deferred call as the EntityTree is not thread-safe. Performance: While convenient, reading data arrays from Mesh resources can affect the frame rate negatively. The data needs to be received from the GPU, stalling the RenderingServer in the process. For performance prefer the use of e.g. collision shapes or creating the data arrays entirely in code.

Parameters
NameTypeDefault
navigationMeshNavigationMesh—
sourceGeometryDataNavigationMeshSourceGeometryData3D—
rootEntityEntity—
callbackCallabledefault
QueryPath2 overloads
# QueryPath · 1/2
C#
public static void QueryPath(NavigationPathQueryParameters3D parameters, NavigationPathQueryResult3D result);

Queries a path in a given navigation map. Start and target position and other parameters are defined through NavigationPathQueryParameters3D. Updates the provided NavigationPathQueryResult3D result object with the path among other results requested by the query. After the process is finished the optional callback will be called.

Parameters
NameTypeDefault
parametersNavigationPathQueryParameters3D—
resultNavigationPathQueryResult3D—
# QueryPath · 2/2
C#
public static void QueryPath(NavigationPathQueryParameters3D parameters, NavigationPathQueryResult3D result, Callable callback = default);

Queries a path in a given navigation map. Start and target position and other parameters are defined through NavigationPathQueryParameters3D. Updates the provided NavigationPathQueryResult3D result object with the path among other results requested by the query. After the process is finished the optional callback will be called.

Parameters
NameTypeDefault
parametersNavigationPathQueryParameters3D—
resultNavigationPathQueryResult3D—
callbackCallabledefault
RegionBakeNavigationMeshvoid · Deprecated
# RegionBakeNavigationMesh
C#
public static void RegionBakeNavigationMesh(NavigationMesh navigationMesh, Entity rootEntity);

Bakes the navigation_mesh with bake source geometry collected starting from the root_node.

Parameters
NameTypeDefault
navigationMeshNavigationMesh—
rootEntityEntity—
RegionCreateRid
# RegionCreate
C#
public static Rid RegionCreate();

Creates a new region.

Returns Rid
RegionGetBoundsAabb
# RegionGetBounds
C#
public static Aabb RegionGetBounds(Rid region);

Returns the axis-aligned bounding box for the region's transformed navigation mesh.

Parameters
NameTypeDefault
regionRid—
Returns Aabb
RegionGetClosestPointVector3
# RegionGetClosestPoint
C#
public static Vector3 RegionGetClosestPoint(Rid region, Vector3 toPoint);

Returns the navigation mesh surface point closest to the provided to_point on the navigation region.

Parameters
NameTypeDefault
regionRid—
toPointVector3—
Returns Vector3
RegionGetClosestPointNormalVector3
# RegionGetClosestPointNormal
C#
public static Vector3 RegionGetClosestPointNormal(Rid region, Vector3 toPoint);

Returns the navigation mesh surface normal closest to the provided to_point on the navigation region.

Parameters
NameTypeDefault
regionRid—
toPointVector3—
Returns Vector3
RegionGetClosestPointToSegmentVector3
# RegionGetClosestPointToSegment
C#
public static Vector3 RegionGetClosestPointToSegment(Rid region, Vector3 start, Vector3 end, bool useCollision = false);

Returns the navigation mesh surface point closest to the provided start and end segment on the navigation region. If use_collision is true, a closest point test is only done when the segment intersects with the navigation mesh surface.

Parameters
NameTypeDefault
regionRid—
startVector3—
endVector3—
useCollisionboolfalse
Returns Vector3
RegionGetConnectionPathwayEndVector3
# RegionGetConnectionPathwayEnd
C#
public static Vector3 RegionGetConnectionPathwayEnd(Rid region, int connection);

Returns the ending point of a connection door. connection is an index between 0 and the return value of NavigationServer3D.RegionGetConnectionsCount.

Parameters
NameTypeDefault
regionRid—
connectionint—
Returns Vector3
RegionGetConnectionPathwayStartVector3
# RegionGetConnectionPathwayStart
C#
public static Vector3 RegionGetConnectionPathwayStart(Rid region, int connection);

Returns the starting point of a connection door. connection is an index between 0 and the return value of NavigationServer3D.RegionGetConnectionsCount.

Parameters
NameTypeDefault
regionRid—
connectionint—
Returns Vector3
RegionGetConnectionsCountint
# RegionGetConnectionsCount
C#
public static int RegionGetConnectionsCount(Rid region);

Returns how many connections this region has with other regions in the map.

Parameters
NameTypeDefault
regionRid—
Returns int
RegionGetEnabledbool
# RegionGetEnabled
C#
public static bool RegionGetEnabled(Rid region);

Returns true if the specified region is enabled.

Parameters
NameTypeDefault
regionRid—
Returns bool
RegionGetEnterCostfloat
# RegionGetEnterCost
C#
public static float RegionGetEnterCost(Rid region);

Returns the enter cost of this region.

Parameters
NameTypeDefault
regionRid—
Returns float
RegionGetIterationIduint
# RegionGetIterationId
C#
public static uint RegionGetIterationId(Rid region);

Returns the current iteration ID of the navigation region. Every time the navigation region changes and synchronizes, the iteration ID increases. An iteration ID of 0 means the navigation region has never synchronized. Note: The iteration ID will wrap around to 1 after reaching its range limit.

Parameters
NameTypeDefault
regionRid—
Returns uint
RegionGetMapRid
# RegionGetMap
C#
public static Rid RegionGetMap(Rid region);

Returns the navigation map Rid the requested region is currently assigned to.

Parameters
NameTypeDefault
regionRid—
Returns Rid
RegionGetNavigationLayersuint
# RegionGetNavigationLayers
C#
public static uint RegionGetNavigationLayers(Rid region);

Returns the region's navigation layers.

Parameters
NameTypeDefault
regionRid—
Returns uint
RegionGetOwnerIdulong
# RegionGetOwnerId
C#
public static ulong RegionGetOwnerId(Rid region);

Returns the ObjectID of the object which manages this region.

Parameters
NameTypeDefault
regionRid—
Returns ulong
RegionGetRandomPointVector3
# RegionGetRandomPoint
C#
public static Vector3 RegionGetRandomPoint(Rid region, uint navigationLayers, bool uniformly);

Returns a random position picked from all region polygons with matching navigation_layers. If uniformly is true, all region polygons and faces are weighted by their surface area (slower). If uniformly is false, just a random polygon and face is picked (faster).

Parameters
NameTypeDefault
regionRid—
navigationLayersuint—
uniformlybool—
Returns Vector3
RegionGetTransformTransform3D
# RegionGetTransform
C#
public static Transform3D RegionGetTransform(Rid region);

Returns the global transformation of this region.

Parameters
NameTypeDefault
regionRid—
Returns Transform3D
RegionGetTravelCostfloat
# RegionGetTravelCost
C#
public static float RegionGetTravelCost(Rid region);

Returns the travel cost of this region.

Parameters
NameTypeDefault
regionRid—
Returns float
RegionGetUseAsyncIterationsbool
# RegionGetUseAsyncIterations
C#
public static bool RegionGetUseAsyncIterations(Rid region);

Returns true if the region uses an async synchronization process that runs on a background thread.

Parameters
NameTypeDefault
regionRid—
Returns bool
RegionGetUseEdgeConnectionsbool
# RegionGetUseEdgeConnections
C#
public static bool RegionGetUseEdgeConnections(Rid region);

Returns true if the navigation region is set to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.

Parameters
NameTypeDefault
regionRid—
Returns bool
RegionOwnsPointbool
# RegionOwnsPoint
C#
public static bool RegionOwnsPoint(Rid region, Vector3 point);

Returns true if the provided point in world space is currently owned by the provided navigation region. Owned in this context means that one of the region's navigation mesh polygon faces has a possible position at the closest distance to this point compared to all other navigation meshes from other navigation regions that are also registered on the navigation map of the provided region. If multiple navigation meshes have positions at equal distance the navigation region whose polygons are processed first wins the ownership. Polygons are processed in the same order that navigation regions were registered on the NavigationServer. Note: If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected.

Parameters
NameTypeDefault
regionRid—
pointVector3—
Returns bool
RegionSetEnabledvoid
# RegionSetEnabled
C#
public static void RegionSetEnabled(Rid region, bool enabled);

If enabled is true, the specified region will contribute to its current navigation map.

Parameters
NameTypeDefault
regionRid—
enabledbool—
RegionSetEnterCostvoid
# RegionSetEnterCost
C#
public static void RegionSetEnterCost(Rid region, float enterCost);

Sets the enter_cost for this region.

Parameters
NameTypeDefault
regionRid—
enterCostfloat—
RegionSetMapvoid
# RegionSetMap
C#
public static void RegionSetMap(Rid region, Rid map);

Sets the map for the region.

Parameters
NameTypeDefault
regionRid—
mapRid—
RegionSetNavigationLayersvoid
# RegionSetNavigationLayers
C#
public static void RegionSetNavigationLayers(Rid region, uint navigationLayers);

Set the region's navigation layers. This allows selecting regions from a path request (when using NavigationServer3D.MapGetPath).

Parameters
NameTypeDefault
regionRid—
navigationLayersuint—
RegionSetNavigationMeshvoid
# RegionSetNavigationMesh
C#
public static void RegionSetNavigationMesh(Rid region, NavigationMesh navigationMesh);

Sets the navigation mesh for the region.

Parameters
NameTypeDefault
regionRid—
navigationMeshNavigationMesh—
RegionSetOwnerIdvoid
# RegionSetOwnerId
C#
public static void RegionSetOwnerId(Rid region, ulong ownerId);

Set the ObjectID of the object which manages this region.

Parameters
NameTypeDefault
regionRid—
ownerIdulong—
RegionSetTransformvoid
# RegionSetTransform
C#
public static void RegionSetTransform(Rid region, Transform3D transform);

Sets the global transformation for the region.

Parameters
NameTypeDefault
regionRid—
transformTransform3D—
RegionSetTravelCostvoid
# RegionSetTravelCost
C#
public static void RegionSetTravelCost(Rid region, float travelCost);

Sets the travel_cost for this region.

Parameters
NameTypeDefault
regionRid—
travelCostfloat—
RegionSetUseAsyncIterationsvoid
# RegionSetUseAsyncIterations
C#
public static void RegionSetUseAsyncIterations(Rid region, bool enabled);

If enabled is true the region uses an async synchronization process that runs on a background thread.

Parameters
NameTypeDefault
regionRid—
enabledbool—
RegionSetUseEdgeConnectionsvoid
# RegionSetUseEdgeConnections
C#
public static void RegionSetUseEdgeConnections(Rid region, bool enabled);

If enabled is true, the navigation region will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.

Parameters
NameTypeDefault
regionRid—
enabledbool—
SetActivevoid
# SetActive
C#
public static void SetActive(bool active);

Control activation of this server.

Parameters
NameTypeDefault
activebool—
SetDebugEnabledvoid
# SetDebugEnabled
C#
public static void SetDebugEnabled(bool enabled);

Changes the flag in a DEBUG_ENABLED build and defers change notification. Without that option the setter body does not execute. Does not create visualization for arbitrary server RIDs.

Parameters
NameTypeDefault
enabledbool—
enabled

true to enable, false to disable. Save and restore the original value for temporary diagnostics.

SimplifyPath2 overloads
# SimplifyPath · 1/2
C#
public static Vector3[] SimplifyPath(Vector3[] path, float epsilon);

Returns a simplified version of path with less critical path points removed. The simplification amount is in world units and controlled by epsilon. 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".

Parameters
NameTypeDefault
pathVector3[]—
epsilonfloat—
Returns Vector3[]
# SimplifyPath · 2/2
C#
public static Vector3[] SimplifyPath(ReadOnlySpan<Vector3> path, float epsilon);

Returns a simplified version of path with less critical path points removed. The simplification amount is in world units and controlled by epsilon. 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".

Parameters
NameTypeDefault
pathReadOnlySpan<Vector3>—
epsilonfloat—
Returns Vector3[]
SourceGeometryParserCreateRid
# SourceGeometryParserCreate
C#
public static Rid SourceGeometryParserCreate();

Creates a new source geometry parser. If a Callable is set for the parser with NavigationServer3D.SourceGeometryParserSetCallback the callback will be called for every single node that gets parsed whenever NavigationServer3D.ParseSourceGeometryData is used.

Returns Rid
SourceGeometryParserSetCallbackvoid
# SourceGeometryParserSetCallback
C#
public static void SourceGeometryParserSetCallback(Rid parser, Callable callback);

Sets the callback Callable for the specific source geometry parser. The Callable will receive a call with the following parameters:

  • navigation_mesh - The NavigationMesh reference used to define the parse settings. Do NOT edit or add directly to the navigation mesh.
  • source_geometry_data - The NavigationMeshSourceGeometryData3D reference. Add custom source geometry for navigation mesh baking to this object.
  • node - The Entity that is parsed.
Parameters
NameTypeDefault
parserRid—
callbackCallable—

Signals and events3

AvoidanceDebugChangedEvent
# AvoidanceDebugChanged
C#
public static event Action AvoidanceDebugChanged;

Emitted when avoidance debug settings are changed. Only available in debug builds.

MapChangedEvent
# MapChanged
C#
public static event NavigationServer3D.MapChangedEventHandler MapChanged;

Emitted when a navigation map is updated, when a region moves or is modified.

Handler parameters
NameTypeDefault
mapRid—
NavigationDebugChangedEvent
# NavigationDebugChanged
C#
public static event Action NavigationDebugChanged;

Emitted when navigation debug settings are changed. Only available in debug builds.

NavigationServer3D.ProcessInfo

ValueDescription
ActiveMaps = 0

Constant to get the number of active navigation maps.

AgentCount = 2

Constant to get the number of active navigation agents processing avoidance.

EdgeConnectionCount = 7

Constant to get the number of navigation mesh polygon edges that are considered connected by edge proximity.

EdgeCount = 5

Constant to get the number of navigation mesh polygon edges.

EdgeFreeCount = 8

Constant to get the number of navigation mesh polygon edges that could not be merged but may be still connected by edge proximity or with links.

EdgeMergeCount = 6

Constant to get the number of navigation mesh polygon edges that were merged due to edge key overlap.

LinkCount = 3

Constant to get the number of active navigation links.

ObstacleCount = 9

Constant to get the number of active navigation obstacles.

PolygonCount = 4

Constant to get the number of navigation mesh polygons.

RegionCount = 1

Constant to get the number of active navigation regions.

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.