Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NavMeshAgent.SetLayerCost

Switch to Manual
public function SetLayerCost(layer: int, cost: float): 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.