NavigationLink3D
Inherits: Entity3D < Entity < Object
Description
Section titled “Description”A link between two positions on NavigationRegion3Ds that agents can be routed through.
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.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| bool | bidirectional |
true |
| bool | enabled |
true |
| Vector3 | end_position |
Vector3(0, 0, 0) |
| float | enter_cost |
0.0 |
| int | navigation_layers |
1 |
| Vector3 | start_position |
Vector3(0, 0, 0) |
| float | travel_cost |
1.0 |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| Vector3 | get_global_end_position() const |
| Vector3 | get_global_start_position() const |
| bool | get_navigation_layer_value(layer_number: int) const |
| RID | get_navigation_map() const |
| RID | get_rid() const |
| void | set_global_end_position(position: Vector3) |
| void | set_global_start_position(position: Vector3) |
| void | set_navigation_layer_value(layer_number: int, value: bool) |
| void | set_navigation_map(navigation_map: RID) |
Property descriptions
Section titled “Property descriptions”bidirectional
bool bidirectional = true
Whether this link can be traveled in both directions or only from start_position to end_position.
enabled
bool enabled = true
Whether this link is currently active. If false, NavigationSystem3D.map_get_path() will ignore this link.
end_position
Vector3 end_position = Vector3(0, 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 NavigationSystem3D.map_set_link_connection_radius().
enter_cost
float enter_cost = 0.0
When pathfinding enters this link from another region’s navigation mesh the enter_cost value is added to the path distance for determining the shortest path.
navigation_layers
int navigation_layers = 1
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with NavigationSystem3D.map_get_path().
start_position
Vector3 start_position = Vector3(0, 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 NavigationSystem3D.map_set_link_connection_radius().
travel_cost
float travel_cost = 1.0
When pathfinding moves along the link the traveled distance is multiplied with travel_cost for determining the shortest path.
Method descriptions
Section titled “Method descriptions”get_global_end_position
Vector3 get_global_end_position() const
Returns the end_position that is relative to the link as a global position.
get_global_start_position
Vector3 get_global_start_position() const
Returns the start_position that is relative to the link as a global position.
get_navigation_layer_value
bool get_navigation_layer_value(layer_number: int) const
Returns whether or not the specified layer of the navigation_layers bitmask is enabled, given a layer_number between 1 and 32.
get_navigation_map
RID get_navigation_map() const
Returns the current navigation map RID used by this link.
get_rid
RID get_rid() const
Returns the RID of this link on the NavigationSystem3D.
set_global_end_position
void set_global_end_position(position: Vector3)
Sets the end_position that is relative to the link from a global position.
set_global_start_position
void set_global_start_position(position: Vector3)
Sets the start_position that is relative to the link from a global position.
set_navigation_layer_value
void set_navigation_layer_value(layer_number: int, value: bool)
Based on value, enables or disables the specified layer in the navigation_layers bitmask, given a layer_number between 1 and 32.
set_navigation_map
void set_navigation_map(navigation_map: RID)
Sets the RID of the navigation map this link should use. By default the link will automatically join the World3D default navigation map so this function is only required to override the default map.
