In this lesson, you will learn how to configure your static geometry and bake a Navigation Mesh (NavMesh) so your AI agents can intelligently calculate paths through your environments.
Defining Static Geometry
Before Unity can generate a walkable surface, it needs to know which objects in your scene are permanent landmarks. If an object is constantly moving, it cannot be part of the baked NavMesh. To mark an object for inclusion, select it in the Inspector and check the Static checkbox at the top right of the Inspector window.
Specifically, for navigation, you should ensure the object is marked as Navigation Static. This tells the NavMesh baking process: "The geometry of this object will never change during gameplay, so please include it in the surface calculation."
The Baking Process
Once your floors, walls, and obstacles are marked as static, you navigate to the Navigation window (found under Window > AI > Navigation). Under the Bake tab, you configure parameters like Agent Radius (how wide your characters are) and Agent Height (how much clearance they need to pass under doorways).
When you click the Bake button, Unity analyzes the geometry marked as static and generates a blue overlay on your scene. This blue mesh represents the "navigable" area where your AI agents are mathematically permitted to walk.
Why Static Matters
Think of the NavMesh as a pre-calculated map. Because the environment is static, Unity can perform expensive pathfinding geometry calculations before you even hit the Play button. By baking the geometry, you avoid calculating complex collision detection at runtime, allowing your AI agents to query paths through the environment with high performance.
If you accidentally leave a critical floor segment unmarked as static, it will not appear in the blue overlay, and your AI will treat it as a void, unable to cross it. Always verify your blue mesh matches your intended walkable paths after baking.
Key Takeaway: Marking objects as Navigation Static allows Unity to pre-calculate walkable surfaces, shifting the performance burden of pathfinding from gameplay execution to the design-time baking phase.