Visualization Setup
This guide covers how to set up visual feedback for AirPath, including path lines, grid overlays, and debug visualization. All visualization is optional — AirPath works without it.
Prerequisites
Complete the Custom Minimal Setup first. You should have a working pathfinding setup before adding visualization.
Creating the Visualization Configuration
- Right-click in your Project window
- Select Create → Pathfinding → Configurations → Visualization Configuration
- Name it
VisualizationConfig
Configuration Reference
Path Visualization Toggles
These toggles control which visual elements are active:
| Setting | Default | Description |
|---|---|---|
| Show Path Line | true | Display a LineRenderer along the calculated path |
| Show Path Cell Colors | false | Highlight start/end grid cells with colored overlays |
| Show Debug Gizmos | false | Draw gizmos in the Scene view for debugging |
| Show Heatmap Grid | false | Display terrain height sampling as a colored grid |
Path Line Settings
Configure how the path line appears:
| Setting | Default | Description |
|---|---|---|
| Path Line Renderer Prefab | — | (Required if Show Path Line is enabled) A prefab with a LineRenderer component |
| Path Line Height | 15 | Height offset above terrain for the path line (0–50) |
| Path Material | — | Material applied to the LineRenderer |
| Path Color | Blue | Color of the path line |
| Path Line Width Curve | Linear | AnimationCurve controlling line width along the path |
| Path Line Width | 2 | Base width of the path line (0.1–5) |
Grid Visualization
Configure terrain grid overlays:
| Setting | Default | Description |
|---|---|---|
| Heat Map Cube Prefab | — | (Required if Show Heatmap Grid is enabled) Prefab for grid cell visualization |
| Path Cell Prefab | — | (Required if Show Path Cell Colors is enabled) Prefab for path cell overlays |
| Cell Transparency | 0.8 | Alpha value for cell overlays (0.1–1) |
| Start Cell Color | Green | Color for the path start position |
| End Cell Color | Red | Color for the path end position |
Debug Settings
| Setting | Default | Description |
|---|---|---|
| Show Boundary Warnings | true | Log warnings when positions are clamped to grid bounds |
| Show Speed Indicators | false | Display agent speed debug info |
| Debug Path Color | Cyan | Color used for debug gizmos |
Setting Up Path Line Visualization
The path line shows a visible line along the calculated path. This is the most common visualization.
Step 1: Create the LineRenderer Prefab
- Create an empty GameObject: GameObject → Create Empty
- Name it
PathLineRenderer - Add a LineRenderer component
- Configure the LineRenderer:
- Positions Size: 0 (AirPath will populate this)
- Width: Set via curve or multiplier
- Material: Assign a material (Unlit or Particles work well)
- Drag the GameObject into your Project to create a prefab
- Delete the GameObject from the scene
Step 2: Assign the Prefab
- Select your
VisualizationConfigasset - Assign the prefab to Path Line Renderer Prefab
- Optionally assign a Path Material
- Ensure Show Path Line is enabled
Step 3: Connect to TerrainController
The TerrainController component handles visualization. Add it to your Terrain:
- Select your Terrain GameObject
- Add the
TerrainControllercomponent (if not already present) - Assign your
PathfindingConfigto Pathfinding Configuration - Assign your
VisualizationConfigto Visualization Configuration
Step 4: Connect to PathfindingManager
- Select your PathfindingManager GameObject
- Assign the Terrain's
TerrainControllerto the Terrain Controller field
Now when you calculate a path, a visible line will appear.
Setting Up Grid Cell Visualization
Grid cell visualization highlights individual cells on the terrain grid.
Creating the Prefabs
Both Heat Map Cube Prefab and Path Cell Prefab need:
- A
MeshRenderercomponent - A simple mesh (cube works well)
- A material that supports transparency
Quick setup:
- Create a cube: GameObject → 3D Object → Cube
- Remove the
BoxCollidercomponent - Create a new material with transparency:
- Rendering Mode: Transparent (for Standard shader)
- Or use Unlit/Transparent shader
- Assign the material to the cube
- Drag to Project to create prefab
- Delete from scene
Create two prefabs (or reuse the same one):
HeatMapCube— for terrain height visualizationPathCell— for start/end position highlighting
Assigning the Prefabs
- Select your
VisualizationConfigasset - Assign Heat Map Cube Prefab (if using heatmap grid)
- Assign Path Cell Prefab (if using path cell colors)
- Enable the corresponding toggles
Visualization Features Explained
Path Line
Shows the calculated path as a continuous line above the terrain. Useful for:
- Confirming paths are calculated correctly
- Visual feedback in games
- Debugging path issues
Path Cell Colors
Highlights the start (green) and end (red) grid cells. Useful for:
- Seeing exact grid cell positions
- Debugging coordinate conversions
- Understanding grid resolution
Heatmap Grid
Displays the entire terrain as colored grid cells based on sampled height. Useful for:
- Understanding how AirPath "sees" your terrain
- Debugging height sampling
- Visualizing grid resolution
The heatmap grid creates one GameObject per grid cell. With a 64×64 grid, that's 4,096 objects. Use only for debugging, not in production.
Debug Gizmos
Draws visualization in the Scene view (not visible in Game view). Shows:
- Path waypoints
- Grid boundaries
- Mode-specific indicators
Minimal Visualization Setup
If you just want basic path visualization without the full setup:
- Create
VisualizationConfigasset - Enable only Show Path Line
- Create a simple LineRenderer prefab
- Assign it to the config
- Add
TerrainControllerto your Terrain with both configs assigned - Reference the TerrainController in PathfindingManager
Everything else is optional.
Troubleshooting
Path line doesn't appear
- Check Show Path Line is enabled
- Verify Path Line Renderer Prefab is assigned
- Ensure the prefab has a
LineRenderercomponent - Check the LineRenderer material is visible (not transparent/culled)
Grid cells don't show colors
- Check Show Path Cell Colors is enabled
- Verify Path Cell Prefab is assigned
- Ensure TerrainController has both configurations assigned
- Check that Show Heatmap Grid is enabled (cells overlay the heatmap)
"Heat map cube prefab is required" warning
Enable Show Heatmap Grid requires the Heat Map Cube Prefab to be assigned. Either assign a prefab or disable the heatmap.
Cells are invisible
- Check your prefab material uses a transparent shader
- Verify Cell Transparency isn't set too low
- Ensure the material color isn't black with 0 alpha
What's Next?
- Performance Tuning — Optimize for your use case