Skip to main content

NavMeshAgent.SetAreaCost(number areaIndex, number areaCost)

Sets the cost for traversing over areas of the area type.

Parameters:

NameTypeDescription
areaIndexnumberArea cost.
areaCostnumberNew cost for the specified area index.

Usage

---@type NavMeshAgent
local navmeshagent;

---@type number
local areaIndex;

---@type number
local areaCost;


navmeshagent.SetAreaCost(areaIndex, areaCost)

Extra Detail

If you enable or disable the agent then the cost will be reset to the default layer cost.