Navigation2D
Inherits: Node2D < CanvasItem < Node < Object
2D navigation and pathfinding node.
Description
Deprecated. Navigation2D
node and get_simple_path are deprecated and will be removed in a future version. Use Navigation2DServer.map_get_path instead.
Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of NavigationPolygon resources. By default, these are automatically collected from child NavigationPolygonInstance nodes.
Tutorials
Properties
| ||
| ||
|
Methods
get_closest_point ( Vector2 to_point ) const | |
get_closest_point_owner ( Vector2 to_point ) const | |
get_rid ( ) const | |
get_simple_path ( Vector2 start, Vector2 end, bool optimize=true ) const |
Property Descriptions
- float cell_size
Default |
|
Setter | set_cell_size(value) |
Getter | get_cell_size() |
The XY plane cell size to use for fields.
- float edge_connection_margin
Default |
|
Setter | set_edge_connection_margin(value) |
Getter | get_edge_connection_margin() |
This value is used to detect the near edges to connect compatible regions.
- int navigation_layers
Default |
|
Setter | set_navigation_layers(value) |
Getter | get_navigation_layers() |
A bitfield determining all navigation map layers the navigation can use on a get_simple_path path query.
Method Descriptions
Returns the navigation point closest to the point given. Points are in local coordinate space.
Returns the owner of the NavigationPolygon which contains the navigation point closest to the point given. This is usually a NavigationPolygonInstance.
- RID get_rid ( ) const
Returns the object’s RID.
- PoolVector2Array get_simple_path ( Vector2 start, Vector2 end, bool optimize=true ) const
Deprecated. Navigation2D
node and get_simple_path are deprecated and will be removed in a future version. Use Navigation2DServer.map_get_path instead.
Returns the path between two given points. Points are in local coordinate space. If optimize
is true
(the default), the path is smoothed by merging path segments where possible.