# GetAreaCost(int)

> Gets the cost for path finding over geometry of the area type.

## Definition

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

```csharp
public static float GetAreaCost(int areaIndex)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the area to get.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

The value applies to all agents unless the value has been customized per agent by calling [NavMeshAgent.SetAreaCost](/engine/6000.6/script-reference/unityengine/ai/navmeshagent/setareacost.md).

Use [NavMesh.GetAreaFromName](/engine/6000.6/script-reference/unityengine/ai/navmesh/getareafromname.md) to find the area index based on the name of the [NavMesh](/engine/6000.6/script-reference/unityengine/ai/navmesh.md) area type.

Additional Resources: [Areas and Costs](https://docs.unity3d.com/Packages/com.unity.ai.navigation@2.0/manual/AreasAndCosts.html)
