# SetPath(NavMeshPath)

> Assign a new path to this agent.

## Definition

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

```csharp
public bool SetPath(NavMeshPath path)
```

### Parameters

**** (\[NavMeshPath]\(/engine/6000.7/script-reference/unityengine/ai/navmeshpath)): New path to follow.

### Returns

| Type                                                          | Description                                |
| ------------------------------------------------------------- | ------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the path is successfully assigned. |

### Remarks

If you successfully assign the path, the agent resumes movement toward the new target. If the path cannot be assigned, the path is cleared (see [NavMeshAgent.ResetPath](/engine/6000.7/script-reference/unityengine/ai/navmeshagent/resetpath.md)). A path that was calculated for a different agent type than this agent's [\_agentTypeID](/engine/6000.7/script-reference/unityengine/ai/navmeshagent/agenttypeid.md) is ignored: the method returns false and the agent keeps its current path. Use [NavMeshAgent.CalculatePath](/engine/6000.7/script-reference/unityengine/ai/navmeshagent/calculatepath.md) or [NavMesh.CalculatePath](/engine/6000.7/script-reference/unityengine/ai/navmesh/calculatepath.md) with a `NavMeshQueryFilter` to obtain a path for this agent type.
