Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- AnimatedSprite2D
- AudioListener2D
- AudioStreamPlayer2D
- BackBufferCopy
- Bone2D
- CPUParticles2D
- Camera2D
- CanvasGroup
- CanvasModulate
- CollisionObject2D (2)
- CollisionPolygon2D
- CollisionShape2D
- GPUParticles2D
- Joint2D (3)
- Light2D (2)
- LightOccluder2D
- Line2D
- Marker2D
- MeshInstance2D
- MultiMeshInstance2D
- NavigationLink2D
- NavigationObstacle2D
- NavigationRegion2D
- Parallax2D
- ParallaxLayer
- Path2D
- PathFollow2D
- Polygon2D
- RayCast2D
- RemoteTransform2D
- ShapeCast2D
- Skeleton2D
- Sprite2D
- TileMap
- TileMapLayer
- TouchScreenButton
- VisibleOnScreenNotifier2D (1)
Table of contents
-
var bidirectional: bool = true -
var enabled: bool = true -
var end_position: Vector2 = Vector2(0, 0) -
var enter_cost: float = 0.0 -
var navigation_layers: int = 1 -
var start_position: Vector2 = Vector2(0, 0) -
var travel_cost: float = 1.0 -
const func get_global_end_position() -> Vector2 -
const func get_global_start_position() -> Vector2 -
const func get_navigation_layer_value(layer_number: int) -> bool -
const func get_navigation_map() -> RID -
const func get_rid() -> RID -
func set_global_end_position(position: Vector2) -> void -
func set_global_start_position(position: Vector2) -> void -
func set_navigation_layer_value(value: bool) -> void -
func set_navigation_map(navigation_map: RID) -> void
NavigationLink2D #
is_instantiable, Node2D, Node, core, not_builtin_classes
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.
Members #
var bidirectional: bool = true#
Whether this link can be traveled in both directions or only from start_position to end_position.
var enabled: bool = true#
Whether this link is currently active. If false, NavigationServer2D.map_get_path will ignore this link.
var end_position: Vector2 = Vector2(0, 0)#
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 NavigationServer2D.map_set_link_connection_radius.
var enter_cost: float = 0.0#
When pathfinding enters this link from another regions navigation mesh the enter_cost value is added to the path distance for determining the shortest path.
var navigation_layers: int = 1#
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with NavigationServer2D.map_get_path.
var start_position: Vector2 = Vector2(0, 0)#
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 NavigationServer2D.map_set_link_connection_radius.
var travel_cost: float = 1.0#
When pathfinding moves along the link the traveled distance is multiplied with travel_cost for determining the shortest path.
Methods #
const func get_global_end_position() -> Vector2#
Returns the end_position that is relative to the link as a global position.
const func get_global_start_position() -> Vector2#
Returns the start_position that is relative to the link as a global position.
const func get_navigation_layer_value(layer_number: int) -> bool#
Returns whether or not the specified layer of the navigation_layers bitmask is enabled, given a layer_number between 1 and 32.
const func get_rid() -> RID#
Returns the RID of this link on the NavigationServer2D.
func set_global_end_position(position: Vector2) -> void#
Sets the end_position that is relative to the link from a global position.
func set_global_start_position(position: Vector2) -> void#
Sets the start_position that is relative to the link from a global position.
func set_navigation_layer_value(value: bool) -> void#
Based on value, enables or disables the specified layer in the navigation_layers bitmask, given a layer_number between 1 and 32.
func set_navigation_map(navigation_map: RID) -> void#
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.