Demo
Welcome to the NavMesh Eraser Demo! This guide will walk you through each step of using NavMesh Eraser to remove, and manage NavMesh areas within Unity.
Last updated
Welcome to the NavMesh Eraser Demo! This guide will walk you through each step of using NavMesh Eraser to remove, and manage NavMesh areas within Unity.
Last updated
Tutoriel video on Unity Asset Store : https://assetstore.unity.com/packages/slug/302354
Open NavMesh Eraser Window
Go to Tools > NavMesh Drawer > NavMesh Eraser
in Unity’s toolbar to open the NavMesh Eraser window.
Verify Your Scene Setup Ensure you’ve completed these prerequisites:
AI Navigation package is installed.
Apply the Terrain
tag to any terrain GameObjects you want to modify.
Create a NavMeshPainter
layer in your project. This layer is used to manage and organize exclusion zones in the scene.
Adjust Brush Settings In the NavMesh Eraser window, customize the brush settings:
Brush Size: Set the diameter for excluding areas on the NavMesh. {INSERT IMAGE}
Preview Color: Choose a color for the brush preview in the Scene view, giving you a clear indication of the area that will be excluded.
Set NavMesh Modifier Volume Properties Define the exclusion properties for each area:
Modifier Size and Modifier Center: Adjust the dimensions and center offset for the NavMesh exclusion volume.
Area Type: Choose Not Walkable
to mark the area as non-navigable.
Affected Agents: Specify which agents are impacted by the exclusion zone (e.g., all agents, specific agents).
Start Exclusion Painting
Click Start Painting
in the NavMesh Eraser window. The brush becomes active in the Scene view, showing a visual representation of the exclusion area.
Excluding Areas on the Terrain Hover the brush over the terrain or other objects, then left-click to exclude that area from the NavMesh. Each exclusion area will automatically be assigned a NavMesh Modifier Volume based on your settings.
Avoid Overlaps NavMesh Eraser checks for existing exclusion zones within the brush area, preventing accidental overlap. This keeps your NavMesh setup organized and efficient.
Stop Painting
When you’re finished excluding or erasing areas, click Stop Painting
in the NavMesh Eraser window. This deactivates the brush and closes the painting session.
Clear All Excluded Areas
If you want to remove all exclusion zones from the scene, click Clear All
in the NavMesh Eraser window. This action deletes all NavMesh Modifier Volumes associated with NavMesh Eraser and removes the parent GameObject for a clean slate.
Open NavMesh Surface Manager Once your exclusion zones are set, open the NavMesh Surface Manager (accessible within NavMesh Eraser ) in the NavMesh Eraser window. This manager allows you to adjust and bake NavMesh settings that include your excluded areas.
Bake the NavMesh
Configure your NavMeshSurface settings as desired, then click Bake NavMesh
to generate the navigation mesh with the exclusion zones applied. This final step ensures that agents respect the marked areas and navigate only in allowed zones.
NavMesh Eraser offers an efficient, visual method to manage non-walkable zones in Unity’s Scene view. With its intuitive brush interface, customizable volumes, and flexible control, this tool empowers you to create precise and complex navigation setups. Enjoy creating tailored navigation zones with NavMesh Eraser and simplify the process of defining non-navigable areas in your Unity projects!