Demo
Welcome to the NavMesh Painter Demo! This guide will walk you through each step of using NavMesh Painter to paint, customize, and manage NavMesh areas within Unity.
Last updated
Welcome to the NavMesh Painter Demo! This guide will walk you through each step of using NavMesh Painter to paint, customize, and manage NavMesh areas within Unity.
Last updated
Tutoriel video on Unity Asset Store : https://assetstore.unity.com/packages/slug/302354
Open NavMesh Painter Window Go to Tools > NavMesh Drawer > Mesh Painter in Unity’s toolbar to open the NavMesh Painter window.
Verify Your Scene Setup Make sure you’ve completed the prerequisites:
Ensure AI Navigation is installed.
Apply the tag and layer of your terrain GameObject.
Create a NavMeshDrawer TAG in your project.
Select Mesh Prefab In the NavMesh Painter window, select the mesh prefab you want to paint in the Scene. This prefab will represent the areas you paint on the terrain. You can create your own brush by placing them in the folder Prefabs
Adjust Brush Settings Customize the brush:
Brush Size: Set the diameter for painting or erasing.
Offset Y: Adjust the vertical offset if you want the painted meshes to sit above the terrain.
Preview Color: Choose a color for the brush preview in the Scene view to see exactly where you’ll paint.
Set NavMesh Modifier Volume Properties Define NavMesh properties for each painted mesh:
Modifier Size and Modifier Center: Customize the volume’s dimensions and center offset.
Area Type: Choose the navigation area type (e.g., Walkable, Not Walkable).
Affected Agents: Specify whether all agents or none are affected by this volume.
Start Painting Click Start Painting in the NavMesh Painter window. Your brush is now active in the Scene view, and you’ll see a visual representation of the brush area.
Painting Areas on the Terrain Hover over the terrain to position the brush, then left-click to paint a mesh in the selected location. Each mesh will automatically be assigned a NavMesh Modifier Volume based on your settings.
Avoid Overlaps NavMesh Painter checks for existing meshes within the brush area to prevent accidental overlaps. You can place meshes freely without worrying about creating unnecessary layers.
Switch to Erase Mode In the NavMesh Painter window, toggle Erase Mode. This will switch the brush function to erasing instead of painting.
Erase Areas Hover over the painted areas and left-click to erase unwanted meshes. The tool will only erase meshes within the brush area and won’t affect other GameObjects in the Scene.
Stop Painting When you’re done painting or erasing, click Stop Painting in the NavMesh Painter window. This will deactivate the brush and close the painting session.
Clean All Meshes If you want to remove all painted meshes, simply click Clean in the NavMesh Painter window. This will delete all painted meshes from the scene and remove the parent GameObject.
Open NavMesh Surface Manager After setting up your painted areas, open the NavMesh Surface Manager (part of NavMesh Painter) in the NavMesh Painter window.
Bake the NavMesh Configure your NavMeshSurface settings and click Bake NavMesh to generate the navigation mesh based on the painted areas. This step finalizes the navigation setup and applies it to the scene.
With NavMesh Painter, you can quickly paint, customize, and manage NavMesh areas in Unity’s Scene view. This tool simplifies the navigation setup process and gives you full control over how agents interact with various areas.
Enjoy creating dynamic and responsive navigation setups with NavMesh Painter!