# SetAreaCost(int, float)

> Sets the pathfinding cost multiplier for this filter for a given area type.

## Definition

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

```csharp
public void SetAreaCost(int areaIndex, float cost)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The area index to set the cost for.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The cost for the supplied area index.

### Remarks

Calling SetAreaCost the first time on a NavMeshQueryFilter object causes an internal allocation of the maximum 32 cost modifiers.
