Skip to content

Api > NavMesh > SetAreaCost()


NavMesh.SetAreaCost(number areaIndex, number cost)⚓︎

Sets the cost for finding path over geometry of the area type on all agents.

Parameters:⚓︎

Name Type Description
areaIndex number Index of the area to set.
cost number New cost.

Usage⚓︎

---@type number
local areaIndex;

---@type number
local cost;


NavMesh:SetAreaCost(areaIndex, cost)

Extra Detail⚓︎

This will replace any custom area costs on all agents, and set the default cost for new agents that are created after calling the function. The cost must be larger than 1.0.