Navigation

    Category: Core

    Mesh-based navigation and pathfinding node.

    Properties

    Description

    Provides navigation and pathfinding within a collection of es. By default these will be automatically collected from child NavigationMeshInstance nodes, but they can also be added on the fly with . In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.

    Method Descriptions

    • get_closest_point ( Vector3 to_point )

    Returns the navigation point closest to the point given. Points are in local coordinate space.


    • get_closest_point_normal ( Vector3 to_point )

    Returns the surface normal at the navigation point closest to the point given. Useful for rotating a navigation agent according to the navigation mesh it moves on.


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


    • Vector3 get_closest_point_to_segment ( start, Vector3 end, use_collision=false )

    Returns the path between two given points. Points are in local coordinate space. If is true (the default), the agent properties associated with each NavigationMesh (radius, height, etc.) are considered in the path calculation, otherwise they are ignored.


    Adds a . Returns an ID for use with navmesh_remove or . If given, a Transform2D is applied to the polygon. The optional is used as return value for .


    • void navmesh_remove ( int id )

    Removes the with the given ID.