Class NavigationLink3D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
A link between two positions on NavigationRegion3Ds that agents can be routed through. These positions can be on the same NavigationRegion3D or on two different ones. Links are useful to express navigation methods other than traveling along the surface of the navigation mesh, such as ziplines, teleporters, or gaps that can be jumped across.
public class NavigationLink3D : Node3D, IDisposable
- Inheritance
-
NavigationLink3D
- Implements
- Inherited Members
Constructors
NavigationLink3D()
public NavigationLink3D()
Properties
Bidirectional
Whether this link can be traveled in both directions or only from StartPosition to EndPosition.
public bool Bidirectional { get; set; }
Property Value
Enabled
Whether this link is currently active. If false
, MapGetPath(Rid, Vector3, Vector3, bool, uint) will ignore this link.
public bool Enabled { get; set; }
Property Value
EndPosition
Ending position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by MapSetLinkConnectionRadius(Rid, float).
public Vector3 EndPosition { get; set; }
Property Value
EnterCost
When pathfinding enters this link from another regions navigation mesh the EnterCost value is added to the path distance for determining the shortest path.
public float EnterCost { get; set; }
Property Value
NavigationLayers
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with MapGetPath(Rid, Vector3, Vector3, bool, uint).
public uint NavigationLayers { get; set; }
Property Value
StartPosition
Starting position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by MapSetLinkConnectionRadius(Rid, float).
public Vector3 StartPosition { get; set; }
Property Value
TravelCost
When pathfinding moves along the link the traveled distance is multiplied with TravelCost for determining the shortest path.
public float TravelCost { get; set; }
Property Value
Methods
GetGlobalEndPosition()
Returns the EndPosition that is relative to the link as a global position.
public Vector3 GetGlobalEndPosition()
Returns
GetGlobalStartPosition()
Returns the StartPosition that is relative to the link as a global position.
public Vector3 GetGlobalStartPosition()
Returns
GetNavigationLayerValue(int)
Returns whether or not the specified layer of the NavigationLayers bitmask is enabled, given a layerNumber
between 1 and 32.
public bool GetNavigationLayerValue(int layerNumber)
Parameters
layerNumber
int
Returns
GetRid()
Returns the Rid of this link on the NavigationServer3D.
public Rid GetRid()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
SetGlobalEndPosition(Vector3)
Sets the EndPosition that is relative to the link from a global position
.
public void SetGlobalEndPosition(Vector3 position)
Parameters
position
Vector3
SetGlobalStartPosition(Vector3)
Sets the StartPosition that is relative to the link from a global position
.
public void SetGlobalStartPosition(Vector3 position)
Parameters
position
Vector3
SetNavigationLayerValue(int, bool)
Based on value
, enables or disables the specified layer in the NavigationLayers bitmask, given a layerNumber
between 1 and 32.
public void SetNavigationLayerValue(int layerNumber, bool value)