NavMeshAgent.SetLayerCost
SetLayerCost(layer: int, cost: float): void;
void SetLayerCost(int layer, float cost);
def SetLayerCost(layer as int, cost as float) as void
Parameters

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 then the cost will be reset to the default layer cost.