Description
The ExcludedBodies
property of the NavMesh
class is a TagSet
that specifies which bodies should be excluded from the navigation mesh generation process. This allows for finer control over which objects are considered when building the navigation mesh, ensuring that certain objects do not interfere with the pathfinding capabilities of AI agents.
Usage
To use the ExcludedBodies
property, you can assign a TagSet
containing the tags of the bodies you wish to exclude from the navigation mesh generation. This is particularly useful when you have objects in your scene that should not be considered as obstacles or navigable surfaces by AI agents.
Example
// Example of setting the ExcludedBodies property
NavMesh navMesh = new NavMesh();
navMesh.ExcludedBodies = new TagSet { "NoNavMesh", "IgnoreForPathfinding" };