Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetAreaCost(int)

Gets the cost for path finding over geometry of the area type.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine.AI
  • Assembly: UnityEngine.AIModule
public static float GetAreaCost(int areaIndex)

Parameters

areaIndex

Index of the area to get.

Returns

Type

Description

float

Remarks

The value applies to all agents unless you the value has been customized per agent by calling NavMeshAgent.SetAreaCost.
Use NavMesh.GetAreaFromName to find the area index based on the name of the NavMesh area type.
Additional Resources: Areas and Costs