NavMeshAgent.SetLayerCost

function SetLayerCost (layer : int, cost : float) : void

Parameters

NameDescription
layer Layer index.
cost New cost for the specified layer.

Description

Sets the cost for traversing over geometry of the layer type.

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