NavMesh Modifier component reference
Use the NavMesh Modifier component to adjust the behavior of a GameObject when the NavMesh is baked at runtime. The NavMesh Modifier component affects the NavMesh during the generation process only. This means the NavMesh is updated to reflect any changes to NavMesh Modifier components when you bake the NavMesh. Use the available properties to specify changes in behavior and any limits to those changes.
To use the NavMesh Modifier component, add it to a GameObject as follows:
- Select the GameObject whose effect on the NavMesh you want to modify.
- In the Inspector, select Add Component, then select Navigation > NavMesh Modifier.
The NavMesh Modifier component is displayed in the Inspector window.
The NavMesh Modifier can also affect the NavMesh generation process hierarchically. This means that the GameObject the component is attached to, as well as all its children, are affected. In addition, you can place another NavMesh Modifier further down the hierarchy to override the NavMesh Modifier that is further up the hierarchy.
To apply the NavMesh Modifier hierarchically, select the Apply To Children property.
Note
The NavMesh Modifier component replaces the legacy Navigation Static setting which you could enable from the Objects tab of the Navigation window and the Static flags dropdown on the GameObject. The NavMesh Modifier component is available for baking at runtime, whereas the Navigation Static flags were available in the Editor only.
The following table describes the properties available in the NavMesh Modifier component.
Property | Description |
---|---|
Mode | Specify whether to consider or ignore the affected GameObject(s). Available options:
|
Affected Agents | Specify which agents the NavMesh Modifier affects. For example, you can choose to have certain obstacles be ignored by specific agents. Available options:
|
Apply to Children | Apply the configuration to the child hierarchy of the GameObject. To override this component's influence further down the hierarchy, add another NavMesh Modifier component. |
Override Area | Change the area type for the affected GameObject(s). To do this, select this checkbox and then select the new area type from the Area Type dropdown that appears. |
Override Generate Links | Force the NavMesh bake process to either include or ignore the affected GameObject(s) when you generate links. To do this, select this checkbox and then select or clear the Generate Links checkbox that appears. |