reckfellENGINE

NavigationServer2D

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

On this page
class NavigationServer2DReckfellSharp

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

NavigationServer2D is the server that handles navigation maps, regions, and agents. It does not handle A* navigation from AStar2D or AStarGrid2D. Maps are divided into regions, which are composed of navigation polygons. Together, they define the traversable areas in the 2D world. Note: Most NavigationServer2D 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 NavigationServer2D.RegionSetNavigationLayers, which then can be checked upon when requesting a path with NavigationServer2D.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 NavigationServer2DInstance Singleton { get; }

Methods140

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

Creates the agent.

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

Return true if the specified agent uses avoidance.

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
AgentGetMapRid
# AgentGetMap
C#
public static Rid AgentGetMap(Rid agent);

Reads the server agent map after processed assignments. Before synchronization it may differ from the Entity locally assigned map.

Parameters
NameTypeDefault
agentRid—
agent

RID of a live 2D server agent.

Returns Rid

Assigned map RID, or a zero RID when unassigned.

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
AgentGetPositionVector2
# AgentGetPosition
C#
public static Vector2 AgentGetPosition(Rid agent);

Returns the position of the specified agent in world space.

Parameters
NameTypeDefault
agentRid—
Returns Vector2
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
AgentGetVelocityVector2
# AgentGetVelocity
C#
public static Vector2 AgentGetVelocity(Rid agent);

Returns the velocity of the specified agent.

Parameters
NameTypeDefault
agentRid—
Returns Vector2
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 NavigationServer2D.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 specified agent uses 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—
AgentSetMapvoid
# AgentSetMap
C#
public static void AgentSetMap(Rid agent, Rid map);

Queues a server agent map change. For a NavigationAgent2D Entity, normally use its SetNavigationMap to align both path queries and server membership.

Parameters
NameTypeDefault
agentRid—
mapRid—
agent

RID of a live server agent, rather than a map, region or Entity ID.

map

2D map RID. Separate maps do not form one shared avoidance simulation.

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, Vector2 position);

Sets the position of the agent in world space.

Parameters
NameTypeDefault
agentRid—
positionVector2—
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—
AgentSetVelocityvoid
# AgentSetVelocity
C#
public static void AgentSetVelocity(Rid agent, Vector2 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 NavigationServer2D.AgentSetVelocityForced instead to reset the internal velocity state.

Parameters
NameTypeDefault
agentRid—
velocityVector2—
AgentSetVelocityForcedvoid
# AgentSetVelocityForced
C#
public static void AgentSetVelocityForced(Rid agent, Vector2 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 far away this function should be used in the same frame. If called frequently this function can get agents stuck.

Parameters
NameTypeDefault
agentRid—
velocityVector2—
BakeFromSourceGeometryDatavoid
# BakeFromSourceGeometryData
C#
public static void BakeFromSourceGeometryData(NavigationPolygon navigationPolygon, NavigationMeshSourceGeometryData2D 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
navigationPolygonNavigationPolygon—
sourceGeometryDataNavigationMeshSourceGeometryData2D—
callbackCallabledefault
navigationPolygon

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(NavigationPolygon navigationPolygon, NavigationMeshSourceGeometryData2D sourceGeometryData, Callable callback = default);

Bakes the provided navigation_polygon 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
navigationPolygonNavigationPolygon—
sourceGeometryDataNavigationMeshSourceGeometryData2D—
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(NavigationServer2D.ProcessInfo processInfo);

Reads a 2D 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
processInfoNavigationServer2D.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.

IsBakingNavigationPolygonbool
# IsBakingNavigationPolygon
C#
public static bool IsBakingNavigationPolygon(NavigationPolygon navigationPolygon);

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

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

Creates a server navigation link and returns its RID. Configure its map, global endpoints and layers; it participates in pathfinding but does not move a character. Release the owned RID with FreeRid.

Returns Rid

RID of the new link. Ownership requires a later FreeRid; a NavigationLink2D Entity manages its own RID separately.

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

Returns true if the specified link is enabled.

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

Returns the ending position of this link.

Parameters
NameTypeDefault
linkRid—
Returns Vector2
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
LinkGetStartPositionVector2
# LinkGetStartPosition
C#
public static Vector2 LinkGetStartPosition(Rid link);

Returns the starting position of this link.

Parameters
NameTypeDefault
linkRid—
Returns Vector2
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);

Enables or disables reverse traversal. With false, traversal remains from the start endpoint to the end. The change requires an updated map version to be published.

Parameters
NameTypeDefault
linkRid—
bidirectionalbool—
bidirectional

true for both directions, false for start → end only.

LinkSetEnabledvoid
# LinkSetEnabled
C#
public static void LinkSetEnabled(Rid link, bool enabled);

Enables or disables link participation after synchronization. Does not stop a character animation or movement already in progress; the game controls those.

Parameters
NameTypeDefault
linkRid—
enabledbool—
enabled

true to enable the link; false to omit its transition from new queries after the map updates.

LinkSetEndPositionvoid
# LinkSetEndPosition
C#
public static void LinkSetEndPosition(Rid link, Vector2 position);

Sets the server link global end endpoint. Moving it outside the connection radius breaks the checked route after synchronization. Does not relocate a gameplay body.

Parameters
NameTypeDefault
linkRid—
positionVector2—
position

Global endpoint position in map coordinates.

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);

Assigns a link to a navigation map. Both endpoints must connect to suitable polygons on that map. Queries see the change after the server publishes its update.

Parameters
NameTypeDefault
linkRid—
mapRid—
link

RID of a live link created by this server.

map

RID of the map containing the intended navigation regions; not a region RID.

LinkSetNavigationLayersvoid
# LinkSetNavigationLayers
C#
public static void LinkSetNavigationLayers(Rid link, uint navigationLayers);

Sets the link own navigation-layer mask. A query must admit both the link and its regions. With regions on layer 1 and a link on layer 2, query mask 3 works; mask 1 excludes the link.

Parameters
NameTypeDefault
linkRid—
navigationLayersuint—
navigationLayers

Unsigned 32-bit mask; layer number N uses bit 1u << (N - 1), rather than the value N.

LinkSetOwnerIdvoid
# LinkSetOwnerId
C#
public static void LinkSetOwnerId(Rid link, ulong ownerId);

Sets an object owner ID for path metadata. The ID differs from the link RID. Assigning it neither creates an object nor transfers its lifetime management to the server.

Parameters
NameTypeDefault
linkRid—
ownerIdulong—
ownerId

For example, GetInstanceId() of the live transition controller. Zero means no assigned object owner.

LinkSetStartPositionvoid
# LinkSetStartPosition
C#
public static void LinkSetStartPosition(Rid link, Vector2 position);

Sets the server link global start endpoint. One-way traversal runs from this endpoint to the end. Connection requires a suitable polygon within the map radius.

Parameters
NameTypeDefault
linkRid—
positionVector2—
position

Global position in map coordinates. Unlike NavigationLink2D.StartPosition, this is not an Entity-local position.

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>
MapGetCellSizefloat
# MapGetCellSize
C#
public static float MapGetCellSize(Rid map);

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

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

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

Parameters
NameTypeDefault
mapRid—
toPointVector2—
Returns Vector2
MapGetClosestPointOwnerRid
# MapGetClosestPointOwner
C#
public static Rid MapGetClosestPointOwner(Rid map, Vector2 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—
toPointVector2—
Returns Rid
MapGetEdgeConnectionMarginfloat
# MapGetEdgeConnectionMargin
C#
public static float MapGetEdgeConnectionMargin(Rid map);

Returns the edge connection margin of the map. The edge connection margin is a distance used to connect two 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>
MapGetPathVector2[]
# MapGetPath
C#
public static Vector2[] MapGetPath(Rid map, Vector2 origin, Vector2 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—
originVector2—
destinationVector2—
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 Vector2[]

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

MapGetRandomPointVector2
# MapGetRandomPoint
C#
public static Vector2 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 Vector2
MapGetRegionsReckfell.Collections.Array<Rid>
# MapGetRegions
C#
public static Reckfell.Collections.Array<Rid> MapGetRegions(Rid map);

Returns registered map regions. Moving a region updates old and new membership when the command is processed. Region membership does not establish polygon readiness.

Parameters
NameTypeDefault
mapRid—
map

RID of the map whose region membership is needed.

Returns Reckfell.Collections.Array<Rid>

Array of region RIDs rather than Entity IDs. May be empty.

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 whether 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);

Checks map participation in server processing, rather than geometry presence or query permission. MapSetActive changes pass through a queue.

Parameters
NameTypeDefault
mapRid—
map

RID of a live 2D map.

Returns bool

true when the map is included in processing; false does not mean an already published path cannot be queried.

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.

MapSetCellSizevoid
# MapSetCellSize
C#
public static void MapSetCellSize(Rid map, float cellSize);

Sets the map cell size used to rasterize the navigation mesh vertices. 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);

Configures the distance for additional near-edge connections. Does not control every map-grid merge or guarantee arbitrary edge connections. Wait for an update and check a new path after changing it.

Parameters
NameTypeDefault
mapRid—
marginfloat—
map

RID of the map whose connections are being configured.

margin

Margin in map units. Excessive values may connect unintended gaps; this does not authorize a physical character to jump a gap.

MapSetLinkConnectionRadiusvoid
# MapSetLinkConnectionRadius
C#
public static void MapSetLinkConnectionRadius(Rid map, float radius);

Sets the polygon search radius around each navigation-link endpoint on the map. This is not the maximum distance between endpoints. Without a suitable polygon near either endpoint, there is no complete transition.

Parameters
NameTypeDefault
mapRid—
radiusfloat—
radius

Radius in map coordinate units; account for it when placing global link endpoints.

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—
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);

Enables or disables additional map edge connections. Disabling does not guarantee separation of edges merged through the grid, as checked with a subcell gap.

Parameters
NameTypeDefault
mapRid—
enabledbool—
enabled

true permits additional connections; false disables this mechanism after the map updates.

ObstacleCreateRid
# ObstacleCreate
C#
public static Rid ObstacleCreate();

Creates a new navigation 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
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
ObstacleGetPositionVector2
# ObstacleGetPosition
C#
public static Vector2 ObstacleGetPosition(Rid obstacle);

Returns the position of the specified obstacle in world space.

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

Returns the radius of the specified dynamic obstacle.

Parameters
NameTypeDefault
obstacleRid—
Returns float
ObstacleGetVelocityVector2
# ObstacleGetVelocity
C#
public static Vector2 ObstacleGetVelocity(Rid obstacle);

Returns the velocity of the specified dynamic obstacle.

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

Returns the outline vertices for the specified obstacle.

Parameters
NameTypeDefault
obstacleRid—
Returns Vector2[]
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—
ObstacleSetMapvoid
# ObstacleSetMap
C#
public static void ObstacleSetMap(Rid obstacle, Rid map);

Sets the navigation map Rid for the obstacle.

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, Vector2 position);

Sets the position of the obstacle in world space.

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

Sets the radius of the dynamic obstacle.

Parameters
NameTypeDefault
obstacleRid—
radiusfloat—
ObstacleSetVelocityvoid
# ObstacleSetVelocity
C#
public static void ObstacleSetVelocity(Rid obstacle, Vector2 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—
velocityVector2—
ObstacleSetVertices2 overloads
# ObstacleSetVertices · 1/2
C#
public static void ObstacleSetVertices(Rid obstacle, Vector2[] 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—
verticesVector2[]—
# ObstacleSetVertices · 2/2
C#
public static void ObstacleSetVertices(Rid obstacle, ReadOnlySpan<Vector2> 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<Vector2>—
ParseSourceGeometryDatavoid
# ParseSourceGeometryData
C#
public static void ParseSourceGeometryData(NavigationPolygon navigationPolygon, NavigationMeshSourceGeometryData2D sourceGeometryData, Entity rootEntity, Callable callback = default);

Parses the EntityTree for source geometry according to the properties of navigation_polygon. Updates the provided source_geometry_data resource with the resulting data. The resource can then be used to bake a navigation mesh with NavigationServer2D.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
navigationPolygonNavigationPolygon—
sourceGeometryDataNavigationMeshSourceGeometryData2D—
rootEntityEntity—
callbackCallabledefault
QueryPath2 overloads
# QueryPath · 1/2
C#
public static void QueryPath(NavigationPathQueryParameters2D parameters, NavigationPathQueryResult2D result);

Executes a query using the parameters and replaces result data. The result does not track a moving target automatically: call again for a new request. The map must exist and be synchronized; a nonempty path can be partial.

Parameters
NameTypeDefault
parametersNavigationPathQueryParameters2D—
resultNavigationPathQueryResult2D—
parameters

Parameters containing the live map, global coordinates, mask and filters. May be reused; explicitly clear obsolete filters and limits.

result

Object receiving this query points, length and selected metadata. Use separate results for independent concurrent requests.

# QueryPath · 2/2
C#
public static void QueryPath(NavigationPathQueryParameters2D parameters, NavigationPathQueryResult2D result, Callable callback = default);

Queries a path in a given navigation map. Start and target position and other parameters are defined through NavigationPathQueryParameters2D. Updates the provided NavigationPathQueryResult2D 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
parametersNavigationPathQueryParameters2D—
resultNavigationPathQueryResult2D—
callbackCallabledefault
RegionCreateRid
# RegionCreate
C#
public static Rid RegionCreate();

Creates a new region.

Returns Rid
RegionGetBoundsRect2
# RegionGetBounds
C#
public static Rect2 RegionGetBounds(Rid region);

Reads processed region-navigation bounds in map space. Wait for an update after transform changes. These are navigation bounds rather than visual-mesh or physics-shape bounds.

Parameters
NameTypeDefault
regionRid—
Returns Rect2

Rectangle bounding region navigation vertices after the applied transform.

RegionGetClosestPointVector2
# RegionGetClosestPoint
C#
public static Vector2 RegionGetClosestPoint(Rid region, Vector2 toPoint);

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

Parameters
NameTypeDefault
regionRid—
toPointVector2—
Returns Vector2
RegionGetConnectionPathwayEndVector2
# RegionGetConnectionPathwayEnd
C#
public static Vector2 RegionGetConnectionPathwayEnd(Rid region, int connection);

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

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

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

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

Returns the region additional connections prepared by the map. Useful for margin-connection diagnostics rather than a universal reachability test: grid merging and query filters require separate checks.

Parameters
NameTypeDefault
regionRid—
Returns int

Number of prepared additional connections; verify a route with a fresh path query.

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);

Reads current server-side region membership. Immediately after RegionSetMap it can still return the previous value before queue processing.

Parameters
NameTypeDefault
regionRid—
region

RID of a live 2D region.

Returns Rid

Assigned map RID, or a zero RID for a detached region.

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
RegionGetRandomPointVector2
# RegionGetRandomPoint
C#
public static Vector2 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 Vector2
RegionGetTransformTransform2D
# RegionGetTransform
C#
public static Transform2D RegionGetTransform(Rid region);

Returns the global transformation of this region.

Parameters
NameTypeDefault
regionRid—
Returns Transform2D
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 whether 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, Vector2 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—
pointVector2—
Returns bool
RegionSetEnabledvoid
# RegionSetEnabled
C#
public static void RegionSetEnabled(Rid region, bool enabled);

Includes or excludes the region in new queries after the map updates. Previously returned path arrays are not rewritten: the game must query again and handle unreachable results.

Parameters
NameTypeDefault
regionRid—
enabledbool—
enabled

true enables the region; false excludes it from new searches after synchronization.

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);

Queues region map assignment. A region belongs to one map; migration removes previous membership. A zero map RID detaches the region without freeing it.

Parameters
NameTypeDefault
regionRid—
mapRid—
region

RID of the live region to assign or detach.

map

2D map RID, or default to detach. Does not transfer ownership of the region RID.

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 NavigationServer2D.MapGetPath).

Parameters
NameTypeDefault
regionRid—
navigationLayersuint—
RegionSetNavigationPolygonvoid
# RegionSetNavigationPolygon
C#
public static void RegionSetNavigationPolygon(Rid region, NavigationPolygon navigationPolygon);

Sets the navigation_polygon for the region.

Parameters
NameTypeDefault
regionRid—
navigationPolygonNavigationPolygon—
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, Transform2D transform);

Sets placement of region navigation geometry on the map. Vertex translation and scaling were verified in the installed 2D server. Does not rebake character clearance or automatically carry a physics body.

Parameters
NameTypeDefault
regionRid—
transformTransform2D—
transform

Transform from local navigation vertices to map space; Identity restores original placement.

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);

Controls region participation in additional edge connections. Disabling broke the checked margin connection between separate rectangles. Grid merging remains a distinct mechanism.

Parameters
NameTypeDefault
regionRid—
enabledbool—
enabled

Whether additional connections are allowed for the region; navigation must update before the change is visible.

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 Vector2[] SimplifyPath(Vector2[] 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
pathVector2[]—
epsilonfloat—
Returns Vector2[]
# SimplifyPath · 2/2
C#
public static Vector2[] SimplifyPath(ReadOnlySpan<Vector2> 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<Vector2>—
epsilonfloat—
Returns Vector2[]
SourceGeometryParserCreateRid
# SourceGeometryParserCreate
C#
public static Rid SourceGeometryParserCreate();

Creates a new source geometry parser. If a Callable is set for the parser with NavigationServer2D.SourceGeometryParserSetCallback the callback will be called for every single node that gets parsed whenever NavigationServer2D.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 NavigationPolygon reference used to define the parse settings. Do NOT edit or add directly to the navigation mesh.
  • source_geometry_data - The NavigationMeshSourceGeometryData2D 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 NavigationServer2D.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.

NavigationServer2D.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.