UnityEngine.AIModule Singleton class to access the baked NavMesh. Describes how far in the future the agents predict collisions for avoidance. Set a function to be called before the NavMesh is updated during the frame update execution. The maximum amount of nodes processed each frame in the asynchronous pathfinding process. Adds a link to the NavMesh. The link is described by the NavMeshLinkData struct. Describing the properties of the link. Representing the added link. Adds a link to the NavMesh. The link is described by the NavMeshLinkData struct. Describing the properties of the link. Translate the link to this position. Rotate the link to this orientation. Representing the added link. Adds the specified NavMeshData to the game. Contains the data for the navmesh. Representing the added navmesh. Adds the specified NavMeshData to the game. Contains the data for the navmesh. Translate the navmesh to this position. Rotate the navmesh to this orientation. Representing the added navmesh. Area mask constant that includes all NavMesh areas. Calculate a path between two points and store the resulting path. The initial position of the path requested. The final position of the path requested. A bitfield mask specifying which NavMesh areas can be passed when calculating a path. The resulting path. True if a either a complete or partial path is found and false otherwise. Calculates a path between two positions mapped to the NavMesh, subject to the constraints and costs defined by the filter argument. The initial position of the path requested. The final position of the path requested. A filter specifying the cost of NavMesh areas that can be passed when calculating a path. The resulting path. True if a either a complete or partial path is found and false otherwise. Calculates triangulation of the current navmesh. Creates and returns a new entry of NavMesh build settings available for runtime NavMesh building. The created settings. Locate the closest NavMesh edge from a point on the NavMesh. The origin of the distance query. Holds the properties of the resulting location. A bitfield mask specifying which NavMesh areas can be passed when finding the nearest edge. True if a nearest edge is found. Locate the closest NavMesh edge from a point on the NavMesh, subject to the constraints of the filter argument. The origin of the distance query. Holds the properties of the resulting location. A filter specifying which NavMesh areas can be passed when finding the nearest edge. True if a nearest edge is found. Gets the cost for path finding over geometry of the area type. Index of the area to get. Returns the area index for a named NavMesh area type. Name of the area to look up. Index if the specified are, or -1 if no area found. Gets the cost for traversing over geometry of the layer type on all agents. Returns the layer index for a named layer. Returns an existing entry of NavMesh build settings. The ID to look for. The settings found. Returns an existing entry of NavMesh build settings by its ordered index. The index to retrieve from. The found settings. Returns the number of registered NavMesh build settings. The number of registered entries. Returns the name associated with the NavMesh build settings matching the provided agent type ID. The ID to look for. The name associated with the ID found. A delegate which can be used to register callback methods to be invoked before the NavMesh system updates. Trace a line between two points on the NavMesh. The origin of the ray. The end of the ray. Holds the properties of the ray cast resulting location. A bitfield mask specifying which NavMesh areas can be passed when tracing the ray. True if the ray is terminated before reaching target position. Otherwise returns false. Traces a line between two positions on the NavMesh, subject to the constraints defined by the filter argument. The origin of the ray. The end of the ray. Holds the properties of the ray cast resulting location. A filter specifying which NavMesh areas can be passed when tracing the ray. True if the ray is terminated before reaching target position. Otherwise returns false. Removes all NavMesh surfaces and links from the game. Removes a link from the NavMesh. The instance of a link to remove. Removes the specified NavMeshDataInstance from the game, making it unavailable for agents and queries. The instance of a NavMesh to remove. Removes the build settings matching the agent type ID. The ID of the entry to remove. Finds the closest point on NavMesh within specified range. The origin of the sample query. Holds the properties of the resulting location. Sample within this distance from sourcePosition. A mask specifying which NavMesh areas are allowed when finding the nearest point. True if a nearest point is found. Samples the position closest to sourcePosition - on any NavMesh built for the agent type specified by the filter. The origin of the sample query. Holds the properties of the resulting location. Sample within this distance from sourcePosition. A filter specifying which NavMesh areas are allowed when finding the nearest point. True if a nearest point is found. Sets the cost for finding path over geometry of the area type on all agents. Index of the area to set. New cost. Sets the cost for traversing over geometry of the layer type on all agents. Navigation mesh agent. The maximum acceleration of an agent as it follows a path, given in units / sec^2. The type ID for the agent. Maximum turning speed in (deg/s) while following a path. Specifies which NavMesh areas are passable. Changing areaMask will make the path stale (see isPathStale). Should the agent brake automatically to avoid overshooting the destination point? Should the agent attempt to acquire a new path if the existing path becomes invalid? Should the agent move across OffMeshLinks automatically? The avoidance priority level. The relative vertical displacement of the owning GameObject. The current OffMeshLinkData. The desired velocity of the agent including any potential contribution from avoidance. (Read Only) Gets or attempts to set the destination of the agent in world-space units. Does the agent currently have a path? (Read Only) The height of the agent for purposes of passing under obstacles, etc. Is the agent currently bound to the navmesh? (Read Only) Is the agent currently positioned on an OffMeshLink? (Read Only) Is the current path stale. (Read Only) This property holds the stop or resume condition of the NavMesh agent. Returns the owning object of the NavMesh the agent is currently placed on (Read Only). The next OffMeshLinkData on the current path. Gets or sets the simulation position of the navmesh agent. The level of quality of avoidance. Property to get and set the current path. Is a path in the process of being computed but not yet ready? (Read Only) The status of the current path (complete, partial or invalid). The avoidance radius for the agent. The distance between the agent's position and the destination on the current path. (Read Only) Maximum movement speed when following a path. Get the current steering target along the path. (Read Only) Stop within this distance from the target position. Gets or sets whether the transform position is synchronized with the simulated agent position. The default value is true. Should the agent update the transform orientation? Allows you to specify whether the agent should be aligned to the up-axis of the NavMesh or link that it is placed on. Access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually. Specifies which NavMesh layers are passable (bitfield). Changing walkableMask will make the path stale (see isPathStale). Enables or disables the current off-mesh link. Is the link activated? Calculate a path to a specified point and store the resulting path. The final position of the path requested. The resulting path. True if a path is found. Completes the movement on the current OffMeshLink. Locate the closest NavMesh edge. Holds the properties of the resulting location. True if a nearest edge is found. Gets the cost for path calculation when crossing area of a particular type. Area Index. Current cost for specified area index. Gets the cost for crossing ground of a particular type. Layer index. Current cost of specified layer. Apply relative movement to current position. The relative movement vector. Trace a straight path towards a target postion in the NavMesh without moving the agent. The desired end position of movement. Properties of the obstacle detected by the ray (if any). True if there is an obstacle between the agent and the target position, otherwise false. Clears the current path. Resumes the movement along the current path after a pause. Sample a position along the current path. A bitfield mask specifying which NavMesh areas can be passed when tracing the path. Terminate scanning the path at this distance. Holds the properties of the resulting location. True if terminated before reaching the position at maxDistance, false otherwise. Sets the cost for traversing over areas of the area type. Area cost. New cost for the specified area index. Sets or updates the destination thus triggering the calculation for a new path. The target point to navigate to. True if the destination was requested successfully, otherwise false. Sets the cost for traversing over geometry of the layer type. Layer index. New cost for the specified layer. Assign a new path to this agent. New path to follow. True if the path is succesfully assigned. Stop movement of this agent along its current path. Warps agent to the provided position. New position to warp the agent to. True if agent is successfully warped, otherwise false. Bitmask used for operating with debug data from the NavMesh build process. All debug data from the NavMesh build process is taken into consideration. The triangles of all the geometry that is used as a base for computing the new NavMesh. No debug data from the NavMesh build process is taken into consideration. Meshes of convex polygons constructed within the unified contours of adjacent regions. The triangulated meshes with height details that better approximate the source geometry. The contours that follow precisely the edges of each surface region. The segmentation of the traversable surfaces into smaller areas necessary for producing simple polygons. Contours bounding each of the surface regions, described through fewer vertices and straighter edges compared to RawContours. The voxels produced by rasterizing the source geometry into walkable and unwalkable areas. Specify which of the temporary data generated while building the NavMesh should be retained in memory after the process has completed. Specify which types of debug data to collect when building the NavMesh. Navigation mesh builder interface. Builds a NavMesh data object from the provided input sources. Settings for the bake process, see NavMeshBuildSettings. List of input geometry used for baking, they describe the surfaces to walk on or obstacles to avoid. Bounding box relative to position and rotation which describes the volume where the NavMesh should be built. Empty bounds is treated as no bounds, i.e. the NavMesh will cover all the inputs. Center of the NavMeshData. This specifies the origin for the NavMesh tiles (See Also: NavMeshBuildSettings.tileSize). Orientation of the NavMeshData, you can use this to generate NavMesh with an arbitrary up-vector – e.g. for walkable vertical surfaces. Returns a newly built NavMeshData, or null if the NavMeshData was empty or an error occurred. The newly built NavMeshData, or null if the NavMeshData was empty or an error occurred. Cancels an asynchronous update of the specified NavMesh data. See Also: UpdateNavMeshDataAsync. The data associated with asynchronous updating. Collects renderers or physics colliders, and terrains within a volume. The queried objects must overlap these bounds to be included in the results. Specifies which layers are included in the query. Which type of geometry to collect - e.g. physics colliders. Area type to assign to results, unless modified by NavMeshMarkup. List of markups which allows finer control over how objects are collected. List where results are stored, the list is cleared at the beginning of the call. Collects renderers or physics colliders, and terrains within a transform hierarchy. If not null, consider only root and its children in the query; if null, includes everything loaded. Specifies which layers are included in the query. Which type of geometry to collect - e.g. physics colliders. Area type to assign to results, unless modified by NavMeshMarkup. List of markups which allows finer control over how objects are collected. List where results are stored, the list is cleared at the beginning of the call. Incrementally updates the NavMeshData based on the sources. The NavMeshData to update. The build settings which is used to update the NavMeshData. The build settings is also hashed along with the data, so changing settings will cause a full rebuild. List of input geometry used for baking, they describe the surfaces to walk on or obstacles to avoid. Bounding box relative to position and rotation which describes the volume where the NavMesh should be built. Empty bounds is treated as no-bounds, that is, the NavMesh will cover all the inputs. Returns true if the update was successful. Asynchronously and incrementally updates the NavMeshData based on the sources. The NavMeshData to update. The build settings which is used to update the NavMeshData. The build settings is also hashed along with the data, so changing settings will likely to cause full rebuild. List of input geometry used for baking, they describe the surfaces to walk on or obstacles to avoid. Bounding box relative to position and rotation which describes to volume where the NavMesh should be built. Empty bounds is treated as no-bounds, that is, the NavMesh will cover all the inputs. Can be used to check the progress of the update. The NavMesh build markup allows you to control how certain objects are treated during the NavMesh build process, specifically when collecting sources for building. The area type to use when override area is enabled. Use this to specify whether the GameObject and its children should be ignored. Use this to specify whether the area type of the GameObject and its children should be overridden by the area type specified in this struct. Use this to specify which GameObject (including the GameObject’s children) the markup should be applied to. The NavMeshBuildSettings struct allows you to specify a collection of settings which describe the dimensions and limitations of a particular agent type. The maximum vertical step size an agent can take. The height of the agent for baking in world units. The radius of the agent for baking in world units. The maximum slope angle which is walkable (angle in degrees). The agent type ID the NavMesh will be baked for. Options for collecting debug data during the build process. The approximate minimum area of individual NavMesh regions. Enables overriding the default tile size. See Also: tileSize. Enables overriding the default voxel size. See Also: voxelSize. Sets the tile size in voxel units. Sets the voxel size in world length units. Validates the properties of NavMeshBuildSettings. Describes the volume to build NavMesh for. The list of violated constraints. The input to the NavMesh builder is a list of NavMesh build sources. Describes the area type of the NavMesh surface for this object. Points to the owning component - if available, otherwise null. The type of the shape this source describes. See Also: NavMeshBuildSourceShape. Describes the dimensions of the shape. Describes the object referenced for Mesh and Terrain types of input sources. Describes the local to world transformation matrix of the build source. That is, position and orientation and scale of the shape. Used with NavMeshBuildSource to define the shape for building NavMesh. Describes a box primitive for use with NavMeshBuildSource. Describes a capsule primitive for use with NavMeshBuildSource. Describes a Mesh source for use with NavMeshBuildSource. Describes a ModifierBox source for use with NavMeshBuildSource. Describes a sphere primitive for use with NavMeshBuildSource. Describes a TerrainData source for use with NavMeshBuildSource. Used for specifying the type of geometry to collect. Used with NavMeshBuilder.CollectSources. Collect geometry from the 3D physics collision representation. Collect meshes form the rendered geometry. Contains and represents NavMesh data. Gets or sets the world space position of the NavMesh data. Gets or sets the orientation of the NavMesh data. Returns the bounding volume of the input geometry used to build this NavMesh (Read Only). Constructs a new object for representing a NavMesh for the default agent type. Constructs a new object representing a NavMesh for the specified agent type. The agent type ID to create a NavMesh for. The instance is returned when adding NavMesh data. Get or set the owning Object. True if the NavMesh data is added to the navigation system - otherwise false (Read Only). Removes this instance from the NavMesh system. Result information for NavMesh queries. Distance to the point of hit. Flag set when hit. Mask specifying NavMesh area at point of hit. Normal at the point of hit. Position of hit. Used for runtime manipulation of links connecting polygons of the NavMesh. Specifies which agent type this link is available for. Area type of the link. If true, the link can be traversed in both directions, otherwise only from start to end position. If positive, overrides the pathfinder cost to traverse the link. End position of the link. Start position of the link. If positive, the link will be rectangle aligned along the line from start to end. An instance representing a link available for pathfinding. Get or set the owning Object. True if the NavMesh link is added to the navigation system - otherwise false (Read Only). Removes this instance from the game. An obstacle for NavMeshAgents to avoid. Should this obstacle be carved when it is constantly moving? Should this obstacle make a cut-out in the navmesh. Threshold distance for updating a moving carved hole (when carving is enabled). Time to wait until obstacle is treated as stationary (when carving and carveOnlyStationary are enabled). The center of the obstacle, measured in the object's local space. Height of the obstacle's cylinder shape. Radius of the obstacle's capsule shape. The shape of the obstacle. The size of the obstacle, measured in the object's local space. Velocity at which the obstacle moves around the NavMesh. Shape of the obstacle. Box shaped obstacle. Capsule shaped obstacle. A path as calculated by the navigation system. Corner points of the path. (Read Only) Status of the path. (Read Only) Erase all corner points from path. NavMeshPath constructor. Calculate the corners for the path. Array to store path corners. The number of corners along the path - including start and end points. Status of path. The path terminates at the destination. The path is invalid. The path cannot reach the destination. Specifies which agent type and areas to consider when searching the NavMesh. The agent type ID, specifying which navigation meshes to consider for the query functions. A bitmask representing the traversable area types. Returns the area cost multiplier for the given area type for this filter. Index to retreive the cost for. The cost multiplier for the supplied area index. Sets the pathfinding cost multiplier for this filter for a given area type. The area index to set the cost for. The cost for the supplied area index. Contains data describing a triangulation of a navmesh. NavMesh area indices for the navmesh triangulation. Triangle indices for the navmesh triangulation. NavMeshLayer values for the navmesh triangulation. Vertices for the navmesh triangulation. Level of obstacle avoidance. Good avoidance. High performance impact. Enable highest precision. Highest performance impact. Enable simple avoidance. Low performance impact. Medium avoidance. Medium performance impact. Disable avoidance. Link allowing movement outside the planar navigation mesh. Is link active. NavMesh area index for this OffMeshLink component. Automatically update endpoints. Can link be traversed in both directions. Modify pathfinding cost for the link. The transform representing link end position. NavMeshLayer for this OffMeshLink component. Is link occupied. (Read Only) The transform representing link start position. Explicitly update the link endpoints. State of OffMeshLink. Is link active (Read Only). Link end world position (Read Only). Link type specifier (Read Only). The OffMeshLink if the link type is a manually placed Offmeshlink (Read Only). Link start world position (Read Only). Is link valid (Read Only). Link type specifier. Vertical drop. Horizontal jump. Manually specified type of link. A world position that is guaranteed to be on the surface of the NavMesh. Unique identifier for the node in the NavMesh to which the world position has been mapped. A world position that sits precisely on the surface of the NavMesh or along its links. The types of nodes in the navigation data. Type of node in the NavMesh representing one surface polygon. Type of node in the NavMesh representing a point-to-point connection between two positions on the NavMesh surface. Object used for doing navigation operations in a NavMeshWorld. Initiates a pathfinding operation between two locations on the NavMesh. Array of custom cost values for all of the 32 possible area types. Each value must be at least 1.0f. This parameter is optional and defaults to the area costs configured in the project settings. See Also: NavMesh.GetAreaCost. Bitmask with values of 1 set at the indices for areas that can be traversed, and values of 0 for areas that are not traversable. This parameter is optional and defaults to NavMesh.AllAreas, if omitted. See Also:. The start location on the NavMesh for the path. The location on the NavMesh where the path ends. InProgress if the operation was successful and the query is ready to search for a path. Failure if the query's NavMeshWorld or any of the received parameters are no longer valid. Returns a valid NavMeshLocation for a position and a polygon provided by the user. World position of the NavMeshLocation to be created. Valid identifier for the NavMesh node. Object containing the desired position and NavMesh node. Creates the NavMeshQuery object and allocates memory to store NavMesh node information, if required. NavMeshWorld object used as an entry point to the collection of NavMesh objects. This object that can be used by query operations. Label indicating the desired life time of the object. (Known issue: Currently allocator has no effect). The number of nodes that can be temporarily stored in the query during search operations. This value defaults to 0 if no other value is specified. Destroys the NavMeshQuery and deallocates all memory used by it. Obtains the number of nodes in the path that has been computed during a successful NavMeshQuery.UpdateFindPath operation. A reference to an int which will be set to the number of NavMesh nodes in the found path. Success when the number of nodes in the path was retrieved correctly. PartialPath when a path was found but it falls short of the desired end location. Failure when the path size can not be evaluated because the preceding call to UpdateFindPath was not successful. Returns the identifier of the agent type the NavMesh was baked for or for which the link has been configured. Identifier of a node from a NavMesh surface or link. Agent type identifier. Copies into the provided array the list of NavMesh nodes that form the path found by the NavMeshQuery operation. Data array to be filled with the sequence of NavMesh nodes that comprises the found path. Number of path nodes successfully copied into the provided array. Returns whether the NavMesh node is a polygon or a link. Identifier of a node from a NavMesh surface or link. Ground when the node is a polygon on a NavMesh surface. OffMeshConnection when the node is a. Obtains the end points of the line segment common to two adjacent NavMesh nodes. First NavMesh node. Second NavMesh node. One of the world points for the resulting separation edge which must be passed through when traversing between the two specified nodes. This point is the left side of the edge when traversing from the first node to the second. One of the world points for the resulting separation edge which must be passed through when traversing between the two specified nodes. This point is the right side of the edge when traversing from the first node to the second. True if a connection exists between the two NavMesh nodes. False if no connection exists between the two NavMesh nodes. Returns true if the node referenced by the specified PolygonId is active in the NavMesh. Identifier of the NavMesh node to be checked. Returns true if the node referenced by the PolygonId contained in the NavMeshLocation is active in the NavMesh. Location on the NavMesh to be checked. Same as checking location.polygon directly. Finds the closest point and PolygonId on the NavMesh for a given world position. World position for which the closest point on the NavMesh needs to be found. Maximum distance, from the specified position, expanding along all three axes, within which NavMesh surfaces are searched. Identifier for the agent type whose NavMesh surfaces should be selected for this operation. The Humanoid agent type exists for all NavMeshes and has an ID of 0. Other agent types can be defined manually through the Editor. A separate NavMesh surface needs to be baked for each agent type. Bitmask used to represent areas of the NavMesh that should (value of 1) or shouldn't (values of 0) be sampled. This parameter is optional and defaults to NavMesh.AllAreas if unspecified. See Also:. An object with position and valid PolygonId - when a point on the NavMesh has been found. An invalid object - when no NavMesh surface with the desired features has been found within the search area. See Also: NavMeshQuery.IsValid. Translates a NavMesh location to another position without losing contact with the surface. Position to be moved across the NavMesh surface. World position you require the agent to move to. Bitmask with values of 1 set at the indices corresponding to areas that can be traversed, and with values of 0 for areas that should not be traversed. This parameter can be omitted, in which case it defaults to NavMesh.AllAreas. See Also:. A new location on the NavMesh placed as closely as possible to the specified target position. The start location is returned when that start is inside an area which is not allowed by the areaMask. Translates a series of NavMesh locations to other positions without losing contact with the surface. Array of positions to be moved across the NavMesh surface. At the end of the method call this array contains the resulting locations. World positions to be used as movement targets by the agent. Filters for the areas which can be traversed during the movement to each of the locations. Translates a series of NavMesh locations to other positions without losing contact with the surface, given one common area filter for all of them. Array of positions to be moved across the NavMesh surface. At the end of the method call this array contains the resulting locations. World positions you want the agent to reach when moving to each of the locations. Filters for the areas which can be traversed during the movement to each of the locations. Returns the transformation matrix of the NavMesh surface that contains the specified NavMesh node (Read Only). NavMesh node for which its owner's transform must be determined. Transformation matrix for the surface owning the specified polygon. Matrix4x4.identity when the NavMesh node is a. Returns the inverse transformation matrix of the NavMesh surface that contains the specified NavMesh node (Read Only). NavMesh node for which its owner's inverse transform must be determined. Inverse transformation matrix of the surface owning the specified polygon. Matrix4x4.identity when the NavMesh node is a. Continues a path search that is in progress. Maximum number of nodes to be traversed by the search algorithm during this call. Outputs the actual number of nodes that have been traversed during this call. InProgress if the search needs to continue further by calling UpdateFindPath again. Success if the search is completed and a path has been found or not. Failure if the search for the desired position could not be completed because the NavMesh has changed significantly since the search was initiated. Additionally the returned value can contain the OutOfNodes flag when the pathNodePoolSize parameter for the NavMeshQuery initialization was not large enough to accommodate the search space. Assembles together a collection of NavMesh surfaces and links that are used as a whole for performing navigation operations. Tells the NavMesh world to halt any changes until the specified job is completed. The job that needs to be completed before the NavMesh world can be modified in any way. Returns a reference to the single NavMeshWorld that can currently exist and be used in Unity. Returns true if the NavMeshWorld has been properly initialized. Bit flags representing the resulting state of NavMeshQuery operations. The node buffer of the query was too small to store all results. The operation has failed. The operation is in progress. A parameter did not contain valid information, useful for carring out the NavMesh query. Operation ran out of memory. Query ran out of node stack space during a search. Query did not reach the end location, returning best guess. Bitmask that has 0 set for the Success, Failure and InProgress bits and 1 set for all the other flags. The operation was successful. Data in the NavMesh cannot be recognized and used. Data in the NavMesh world has a wrong version. Represents a compact identifier for the data of a NavMesh node. Returns true if two PolygonId objects refer to the same NavMesh node. Returns true if two PolygonId objects refer to the same NavMesh node. Returns the hash code for use in collections. Returns true if the PolygonId has been created empty and has never pointed to any node in the NavMesh. Returns true if two PolygonId objects refer to the same NavMesh node or if they are both null. Returns true if two PolygonId objects refer to different NavMesh nodes or if only one of them is null. The AI module implements the path finding features in Unity.