reckfellENGINE

NavigationLink2D

A link between two positions on NavigationRegion2Ds that agents can be routed through.

On this page
class NavigationLink2DReckfellSharpInherits Entity2D

A link between two positions on NavigationRegion2Ds that agents can be routed through.

A link between two positions on NavigationRegion2Ds that agents can be routed through. These positions can be on the same NavigationRegion2D or on two different ones. Links are useful to express navigation methods other than traveling along the surface of the navigation polygon, such as ziplines, teleporters, or gaps that can be jumped across.

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

Constructors1

NavigationLink2DConstructor
# NavigationLink2D
C#
public NavigationLink2D();

Properties7

BidirectionalProperty
# Bidirectional
C#
public bool Bidirectional { get; set; }

Whether this link can be traveled in both directions or only from NavigationLink2D.StartPosition to NavigationLink2D.EndPosition.

EnabledProperty
# Enabled
C#
public bool Enabled { get; set; }

Whether this link is currently active. If false, NavigationServer2D.MapGetPath will ignore this link.

EndPositionProperty
# EndPosition
C#
public Vector2 EndPosition { get; set; }

End endpoint in the link Entity local coordinates. Moving the Entity updates server-global endpoints; this position does not teleport a gameplay body.

EnterCostProperty
# EnterCost
C#
public float EnterCost { get; set; }

When pathfinding enters this link from another region's navigation mesh the NavigationLink2D.EnterCost value is added to the path distance for determining the shortest path.

NavigationLayersProperty
# NavigationLayers
C#
public uint NavigationLayers { get; set; }

A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with NavigationServer2D.MapGetPath.

StartPositionProperty
# StartPosition
C#
public Vector2 StartPosition { get; set; }

Start endpoint in the link Entity local coordinates. Transformed by the Entity global transform before submission to the server. Server LinkSetStartPosition expects a global position instead.

TravelCostProperty
# TravelCost
C#
public float TravelCost { get; set; }

When pathfinding moves along the link the traveled distance is multiplied with NavigationLink2D.TravelCost for determining the shortest path.

Methods23

GetEndPositionVector2
# GetEndPosition
C#
public Vector2 GetEndPosition();
Returns Vector2
GetEnterCostfloat
# GetEnterCost
C#
public float GetEnterCost();
Returns float
GetGlobalEndPositionVector2
# GetGlobalEndPosition
C#
public Vector2 GetGlobalEndPosition();

Returns the NavigationLink2D.EndPosition that is relative to the link as a global position.

Returns Vector2
GetGlobalStartPositionVector2
# GetGlobalStartPosition
C#
public Vector2 GetGlobalStartPosition();

Returns the NavigationLink2D.StartPosition that is relative to the link as a global position.

Returns Vector2
GetNavigationLayerValuebool
# GetNavigationLayerValue
C#
public bool GetNavigationLayerValue(int layerNumber);

Returns whether or not the specified layer of the NavigationLink2D.NavigationLayers bitmask is enabled, given a layer_number between 1 and 32.

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

Returns the current navigation map Rid used by this link.

Returns Rid
GetRidRid
# GetRid
C#
public Rid GetRid();

Returns the Rid of this link on the NavigationServer2D.

Returns Rid
GetStartPositionVector2
# GetStartPosition
C#
public Vector2 GetStartPosition();
Returns Vector2
GetTravelCostfloat
# GetTravelCost
C#
public float GetTravelCost();
Returns float
IsBidirectionalbool
# IsBidirectional
C#
public bool IsBidirectional();
Returns bool
IsEnabledbool
# IsEnabled
C#
public bool IsEnabled();
Returns bool
SetBidirectionalvoid
# SetBidirectional
C#
public void SetBidirectional(bool bidirectional);
Parameters
NameTypeDefault
bidirectionalbool—
SetEnabledvoid
# SetEnabled
C#
public void SetEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetEndPositionvoid
# SetEndPosition
C#
public void SetEndPosition(Vector2 position);
Parameters
NameTypeDefault
positionVector2—
SetEnterCostvoid
# SetEnterCost
C#
public void SetEnterCost(float enterCost);
Parameters
NameTypeDefault
enterCostfloat—
SetGlobalEndPositionvoid
# SetGlobalEndPosition
C#
public void SetGlobalEndPosition(Vector2 position);

Sets the NavigationLink2D.EndPosition that is relative to the link from a global position.

Parameters
NameTypeDefault
positionVector2—
SetGlobalStartPositionvoid
# SetGlobalStartPosition
C#
public void SetGlobalStartPosition(Vector2 position);

Sets the NavigationLink2D.StartPosition that is relative to the link from a global position.

Parameters
NameTypeDefault
positionVector2—
SetNavigationLayerValuevoid
# SetNavigationLayerValue
C#
public void SetNavigationLayerValue(int layerNumber, bool value);

Based on value, enables or disables the specified layer in the NavigationLink2D.NavigationLayers bitmask, given a layer_number between 1 and 32.

Parameters
NameTypeDefault
layerNumberint—
valuebool—
SetNavigationLayersvoid
# SetNavigationLayers
C#
public void SetNavigationLayers(uint navigationLayers);
Parameters
NameTypeDefault
navigationLayersuint—
SetNavigationMapvoid
# SetNavigationMap
C#
public void SetNavigationMap(Rid navigationMap);

Sets the Rid of the navigation map this link should use. By default the link will automatically join the World2D default navigation map so this function is only required to override the default map.

Parameters
NameTypeDefault
navigationMapRid—
SetStartPositionvoid
# SetStartPosition
C#
public void SetStartPosition(Vector2 position);
Parameters
NameTypeDefault
positionVector2—
SetTravelCostvoid
# SetTravelCost
C#
public void SetTravelCost(float travelCost);
Parameters
NameTypeDefault
travelCostfloat—
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.