BeginFindPath(NavMeshLocation, NavMeshLocation, int, NativeArray<float>)
Initiates a pathfinding operation between two locations on the NavMesh.
Read time 1 minuteLast updated 8 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Experimental.AI
- Assembly: UnityEngine.AIModule
public PathQueryStatus BeginFindPath(NavMeshLocation start, NavMeshLocation end, int areaMask = -1, NativeArray<float> costs = default)
Parameters
The start location on the NavMesh for the path.
The location on the NavMesh where the path ends.
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.
Array of custom cost values for all of the 32 possible area types. Each value must be at least . This parameter is optional and defaults to the area costs configured in the project settings.
1.0fReturns
Type | Description |
|---|---|
| PathQueryStatus | |
Remarks
The path always begins at the specified location. If the desired end location is not directly accessible, the search algorithm tries to find a valid location nearby.
Calling this method overrides the progress made by this NavMeshQuery in the previous pathfinding operation.
NavMeshQuery.UpdateFindPath should be called after this method to process the path search.