Navigation2D

    2D navigation and pathfinding node.

    Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of resources. By default, these are automatically collected from child NavigationPolygonInstance nodes, but they can also be added on the fly with .

    • get_closest_point ( Vector2 to_point )

    • get_closest_point_owner ( Vector2 to_point )

    Returns the owner of the which contains the navigation point closest to the point given. This is usually a NavigationPolygonInstance. For polygons added via , returns the owner that was given (or if the parameter was omitted).


    Returns the path between two given points. Points are in local coordinate space. If is (the default), the path is smoothed by merging path segments where possible.



    • void navpoly_remove ( int id )

    Removes the with the given ID.


    • void navpoly_set_transform ( int id, xform )

    Sets the transform applied to the NavigationPolygon with the given ID.