bool IncludeStaticBodies { get; set; }

robot_2Generated
code_blocksInput

Description

The IncludeStaticBodies property of the NavMesh class determines whether static bodies should be included in the navigation mesh generation process. Static bodies are those that do not move or change over time, and including them can affect the navigation paths calculated by the AI.

Usage

To use the IncludeStaticBodies property, you can set it to true or false depending on whether you want static bodies to be considered during the navigation mesh generation. This can be useful for optimizing the navigation mesh by excluding unnecessary static objects or ensuring that all relevant static objects are included.

Example

// Example of setting the IncludeStaticBodies property
NavMesh navMesh = new NavMesh();
navMesh.IncludeStaticBodies = true; // Include static bodies in the nav mesh generation

// Later in the code, you might want to change this setting
navMesh.IncludeStaticBodies = false; // Exclude static bodies from the nav mesh generation