2025-05-18 01:04:31 +08:00

3.8 KiB

NavMeshModifier

NavMesh Modifiers adjust how a specific GameObject behaves during NavMesh baking at runtime.

To use the NavMesh Modifier component, navigate to GameObject > AI > NavMesh Modifier.

In the image below, the platform in the bottom right has a modifier attached to it that sets its Area Type to Lava.

NavMeshModifier example

The NavMesh Modifier optionally affects GameObjects hierarchically, meaning the GameObject that the component is attached to as well as all its children are affected. Additionally, if another NavMesh Modifier is found further down the transform hierarchy, the new NavMesh Modifier overrides the one further up the hierarchy.
To enable this behaviour use the Apply To Children option.

The NavMesh Modifier affects the NavMesh generation process, meaning the NavMesh has to be updated to reflect any changes to NavMesh Modifiers.

--

Note: This component is a replacement for the legacy setting which could be enabled from the Navigation window Objects tab as well as the static flags dropdown on the GameObject. This component is available for baking at runtime, whereas the static flags are available in the editor only.

Parameters

Property Function
Mode Depending on this value the affected object(s) will be removed or considered during the build process.
- Add or Modify Object : objects are considered during the build process
- Remove Object : objects are discarded from the build process
Affected Agents A selection of Agents the Modifier affects. For example, you may choose to exclude certain obstacles from specific Agents.
Apply To Children Check this tickbox to apply the configuration to the GameObject children hierarchy.
You can still override this component's influence down the hierarchy line by adding another NavMesh Modifier component.
Override Area Type Check this tickbox to change the area type for the affected GameObject(s).
Area Type Select the new area type to apply from the drop-down menu.
Override Generate Links Check this tickbox to force the way the affected GameObject(s) will be considered by the NavMesh baking links generation.
Generate Links Check this tickbox to consider the GameObject(s) during links generation, uncheck it to remove them from the link generation.