Navigation

Inherits: Spatial < Node < Object

Mesh-based navigation and pathfinding node.

Description

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

Properties

Vector3up_vectorVector3( 0, 1, 0 )

Property Descriptions

DefaultVector3( 0, 1, 0 )
Setterset_up_vector(value)
Getterget_up_vector()

Defines which direction is up. By default, this is (0, 1, 0), which is the world’s “up” direction.

Method Descriptions

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


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 NavigationMesh which contains the navigation point closest to the point given. This is usually a NavigationMeshInstance. For meshes added via navmesh_add, returns the owner that was given (or null if the owner parameter was omitted).


Returns the navigation point closest to the given line segment. When enabling use_collision, only considers intersection points between segment and navigation meshes. If multiple intersection points are found, the one closest to the segment start point is returned.


Returns the path between two given points. Points are in local coordinate space. If optimize 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 NavigationMesh. Returns an ID for use with navmesh_remove or navmesh_set_transform. If given, a Transform2D is applied to the polygon. The optional owner is used as return value for get_closest_point_owner.


  • void navmesh_remove ( int id )

Removes the NavigationMesh with the given ID.


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

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.