Skip to main content

NavMesh.SetAreaCost(number areaIndex, number cost)

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

Parameters:

NameTypeDescription
areaIndexnumberIndex of the area to set.
costnumberNew 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.