# BeginFindPath(NavMeshLocation, NavMeshLocation, int, NativeArray<float>)

> Initiates a pathfinding operation between two locations on the NavMesh.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Experimental.AI](/engine/6000.6/script-reference/unityengine/experimental/ai.md)
* **Assembly:** UnityEngine.AIModule

> **Warning:**
>
> **Deprecated.** The experimental NavMeshQuery struct has been deprecated. Use NavWorld instead.

```csharp
public PathQueryStatus BeginFindPath(NavMeshLocation start, NavMeshLocation end, int areaMask = -1, NativeArray<float> costs = default)
```

### Parameters

**** (\[NavMeshLocation]\(/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshlocation)): The start location on the NavMesh for the path.**** (\[NavMeshLocation]\(/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshlocation)): The location on the NavMesh where the path ends.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): 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](/engine/6000.6/script-reference/unityengine/ai/navmesh/allareas.md), if omitted.**** (\[NativeArray\<float>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): 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.

### Returns

| Type                                                                                              | Description                                                                               |
| ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| [PathQueryStatus](/engine/6000.6/script-reference/unityengine/experimental/ai/pathquerystatus.md) | `InProgress` if the operation was successful and the query is ready to search for a path. |

### 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](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshquery.md) in the previous pathfinding operation.

[NavMeshQuery.UpdateFindPath](/engine/6000.6/script-reference/unityengine/experimental/ai/navmeshquery/updatefindpath.md) should be called after this method to process the path search.

Additional Resources: [PathQueryStatus](/engine/6000.6/script-reference/unityengine/experimental/ai/pathquerystatus.md), [NavMesh.GetAreaCost](/engine/6000.6/script-reference/unityengine/ai/navmesh/getareacost.md), [Areas and Costs](https://docs.unity3d.com/Packages/com.unity.ai.navigation@2.0/manual/AreasAndCosts.html)
