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. For polygons added via navpolyAdd, returns the owner that was given (or null if the owner parameter was omitted).
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. Note: This method has known issues and will often return non-optimal paths. These issues will be fixed in Godot 4.0.
Adds a NavigationPolygon. Returns an ID for use with navpolyRemove or navpolySetTransform. If given, a Transform2D is applied to the polygon. The optional owner is used as return value for getClosestPointOwner.
Removes the NavigationPolygon with the given ID.
Sets the transform applied to the NavigationPolygon with the given ID.
Construct a new instance of Navigation2D. Note: use memnew!Navigation2D instead.
2D navigation and pathfinding node.
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, but they can also be added on the fly with navpolyAdd. Note: The current navigation system has many known issues and will not always return optimal paths as expected. These issues will be fixed in Godot 4.0.