Skip to content

Navmesh and Pathfinding

Zombies in a published Unturned™ map walk directly into walls, cluster on the wrong side of a building, or refuse to pursue players at all. The cause in almost every case is a missing or incorrectly baked navmesh. The navmesh is the data structure that tells the Unturned™ AI where it can walk. Without a valid navmesh, zombies have no path to compute and fall back to the engine's error behavior — which in practice means they stand in place or oscillate against any surface that blocks them.

This article documents the navmesh bake workflow that 57 Studios™ uses for custom Unturned™ maps. The workflow covers the Unity NavMesh bake process, the agent settings that control which terrain agents can traverse, off-mesh links for stairs and doorways, and the diagnostic steps for the most common bake failures. The article is specific to Unturned™ map modding using the Unity 2022.3 LTS project that Smartly Dressed Games provides to map modders.

Unity Scene view showing baked blue navmesh surface over a custom map terrain

Prerequisites

  • Unity 2022.3 LTS installed and the Unturned™ map project open. See the Unity setup documentation if the project is not yet configured.
  • A map terrain with placed objects (buildings, props, barriers). The navmesh bake is performed against the scene's geometry; baking against an empty terrain produces a navmesh with no meaningful obstacles.
  • The Window > AI > Navigation panel open in the Unity Editor. This is the primary interface for navmesh configuration.
  • A working map export and test loop. The navmesh must be exported with the map bundle and tested in Unturned™ single-player to verify zombie behavior.

What you will learn

  • How Unity's NavMesh system works and how Unturned™ consumes the baked output.
  • How to configure NavMesh Agent settings for Unturned™ zombies (radius, height, slope, step height).
  • How to bake the navmesh for a custom map terrain with placed objects.
  • How to author off-mesh links for doorways, stairs, ledges, and shortcuts.
  • How to read the bake output and identify coverage gaps.
  • How to diagnose the most common bake failures, including the wall-walking issue.
  • How to iterate the bake after changing map geometry.

How Unturned's navmesh system works

Unturned™ uses Unity's built-in NavMesh system for all ground-based AI navigation. The navmesh is a triangulated polygon mesh that represents the walkable surface of the map. At runtime, the AI navigation system uses the A* pathfinding algorithm to find the shortest path between two points on the navmesh. If no path exists on the navmesh, the AI cannot reach the target.

The bake is a pre-computation step performed in the Unity Editor. The bake reads the scene's geometry, applies the agent settings to determine which surfaces are walkable, and outputs the navmesh data. The output is saved to the map's NavMesh.asset file. When the map is exported, the navmesh asset is included in the bundle.

The distinction between the bake-time and runtime phases matters for troubleshooting. A zombie that walks into a wall is experiencing a runtime pathfinding failure — the path exists on the navmesh, but the navmesh does not accurately represent the geometry it was baked against (because the bake settings were incorrect or the geometry changed after baking). A zombie that refuses to move at all is experiencing a no-path signal — no walkable path exists between the zombie's spawn point and the player.

Agent settings

Agent settings define the physical capabilities of the AI agent that the navmesh is baked for. The bake uses these settings to determine which surfaces are walkable. Unturned™ zombies are standard humanoid agents; the cohort-validated settings below produce a navmesh that matches zombie movement behavior.

Core agent parameters

ParameterCohort-validated valueDescription
Agent Radius0.4 mThe radius of the agent's capsule collider. Surfaces narrower than 2× radius are not walkable. Use 0.4 m for zombies; wider settings exclude narrow corridors.
Agent Height1.8 mThe height of the agent's capsule. Surfaces with less than this height of clearance are not walkable.
Max Slope45°The steepest terrain angle the agent can traverse. Unturned™ map terrain rarely exceeds 40° on playable paths; 45° provides a margin.
Step Height0.4 mThe maximum height of a single step the agent can climb. Matches Unturned™ stair geometry.

Agent radius and narrow geometry

An agent radius of 0.4 m means that any gap narrower than 0.8 m in the scene will be excluded from the navmesh. Standard doorways in the Unturned™ asset library are 1.0–1.2 m wide, which passes the 0.8 m minimum. Custom asset doorways narrower than 0.8 m will not be traversable by the default zombie agent without an off-mesh link.

Voxelization settings (Advanced panel)

The Advanced panel in the Navigation window exposes the voxelization settings that control bake resolution and obstacle handling.

SettingCohort-validated valueDescription
Voxel Size0.1667 mControls bake resolution. Smaller = finer detail but longer bake time. The default of 1/6 of agent radius is appropriate for most maps.
Min Region Area2 m²Removes navmesh islands smaller than this area. Prevents small, isolated navmesh patches from generating useless pathfinding targets.
Height MeshEnabledGenerates an accurate height mesh in addition to the flat navmesh. Required for correct vertical positioning of agents on sloped terrain.
Manual Voxel SizeDisabledAllows overriding the default voxel size. Enable only when specific fine-detail baking is needed for a section of the map.

What voxel size affects

Reducing voxel size improves navmesh accuracy in tight spaces but increases bake time quadratically. On a 1024×1024 unit map, reducing voxel size from 0.1667 to 0.08 can increase bake time from 2 minutes to 15 minutes. The 57 Studios™ recommendation is to use the default voxel size for the majority of the map and override it only for sections with very dense, intricate geometry.

Bake settings comparison table

Map archetypeAgent RadiusMax SlopeStep HeightNotes
Standard map (mixed)0.4 m45°0.4 mDefault for most custom maps
Dense urban0.35 m40°0.35 mTighter radius navigates narrow alleys
Forested / wilderness0.45 m50°0.5 mLarger radius, higher slope for uneven terrain
Interior-heavy (bunker)0.3 m35°0.3 mSmallest radius for dense interior corridors
Military compound0.4 m45°0.5 mHigher step height for military stair geometry

How to bake the navmesh

The following procedure is the 57 Studios™ validated bake workflow for a custom Unturned™ map.

Step 1: Mark geometry as Navigation Static

The navmesh bake only considers GameObjects that are marked as Navigation Static. Objects that are not marked are transparent to the bake — the navmesh is generated through them as if they do not exist.

  1. In the Unity Hierarchy, select all terrain and scene geometry that should block or support zombie navigation. This includes: terrain, all building prefabs, walls, barriers, bridges, stairs.
  2. In the Inspector, find the Flags dropdown (top right of the Inspector header, next to the tag/layer selectors).
  3. Enable the Navigation Static flag. The flag is independent of the Static checkbox; enabling the top-level Static checkbox automatically enables all sub-flags including Navigation Static.
  4. Apply to children when prompted. All child GameObjects of a building prefab must also be Navigation Static for the geometry to be fully represented in the bake.

Dynamic objects and Navigation Static

Do not mark dynamic objects (vehicles, props that can be destroyed, doors that open) as Navigation Static. Dynamic Navigation Static objects require NavMeshObstacle components and runtime navmesh updates, which are expensive. The 57 Studios™ recommendation is to treat the navmesh as a static representation of the walkable surface and rely on agent avoidance for dynamic obstacles.

Step 2: Configure agent settings

  1. Open Window > AI > Navigation.
  2. Select the Agents tab.
  3. Confirm the default agent (typically named "Humanoid") has the cohort-validated settings: Radius 0.4, Height 1.8, Max Slope 45, Step Height 0.4.
  4. If additional agent types are needed (e.g., a slower, larger boss zombie), add new agent types here.

Step 3: Configure bake settings

  1. In the Navigation window, select the Bake tab.
  2. Set Agent Radius to 0.4.
  3. Set Agent Height to 1.8.
  4. Set Max Slope to 45.
  5. Set Step Height to 0.4.
  6. Expand the Advanced section. Enable Height Mesh.
  7. Confirm Min Region Area is 2.

Step 4: Bake

  1. Click Bake at the bottom of the Navigation window.
  2. The bake progress bar appears in the Unity Editor status bar. A 1024×1024 map typically takes 1–5 minutes depending on geometry complexity.
  3. After bake completes, the navmesh is displayed in the Scene view as a blue overlay on walkable surfaces. Areas not covered by blue are not walkable.

Inspecting bake coverage

After baking, use the Navigation window's Scene Filter to show only the navmesh. Walk through every area of the map in the Scene view and look for: gaps over doorways and stairways (requires off-mesh links), missing coverage on flat rooftops that should be reachable, coverage on surfaces that should not be walkable (inside walls, under the terrain).

Step 5: Save the scene

Save the scene after baking. The navmesh is stored in the NavMesh.asset file that Unity creates alongside the scene file. Do not skip this step — an unsaved bake will not be included in the map export.

Navigation window Bake tab with agent settings filled in and the bake button highlighted

Off-mesh links are user-defined connections between two points on the navmesh that are not naturally connected by the bake. They are required for:

  • Doorways and window openings that the bake cannot traverse because the opening geometry creates a navmesh gap.
  • Staircases where the step geometry confuses the bake and produces a gap between floor levels.
  • Drop-down ledges where the agent can fall from a higher surface to a lower one.
  • Shortcuts such as manhole covers, hatches, or vents.
  1. Select the building or object that has the connection point.
  2. In the Inspector, click Add Component and add the Off Mesh Link component.
  3. Set the Start transform to the navmesh point on one side of the gap (e.g., the hallway floor just outside the doorway).
  4. Set the End transform to the navmesh point on the other side of the gap (e.g., the room floor just inside the doorway).
  5. Set the Cost Override to 1 (default). Higher values make the link less preferred; lower values make the link preferred over longer routes.
  6. Enable Bidirectional if the agent can traverse the link in both directions (doorways). Disable for one-way links (drop-down ledges).
  7. Enable Activated. A disabled off-mesh link is never used.
  8. Re-bake the navmesh. Off-mesh links appear as arcs on the navmesh visualization.

Off-mesh link placement precision

The Start and End transforms of an off-mesh link must be placed on valid navmesh surfaces — not in the air, not inside geometry. Place them at least 0.5 m from any obstacle edge. Links whose endpoints are not on valid navmesh fail silently: the link appears in the visualization but is never used in pathfinding.

ScenarioLink typeStart placementEnd placement
Doorway (standard)Bidirectional0.5 m outside door frame0.5 m inside door frame
Staircase (ascending)BidirectionalBottom stair landingTop stair landing
Drop ledgeOne-wayEdge of upper surface, 0.3 m backLower surface, directly below
Hatch / trapdoorBidirectionalFloor adjacent to hatchFloor below hatch
Window (climbable)BidirectionalFloor outside windowFloor inside window

Why zombies walk into walls

Zombie wall-walking is one of the most frequently reported navmesh issues in community map projects. It has several distinct root causes, each with a specific fix.

Cause 1: Navmesh not baked after geometry changes

The bake is a snapshot of the scene geometry at the time the Bake button was clicked. If geometry is added, moved, or removed after the last bake, the navmesh no longer matches the current scene. Zombies pathfind against the outdated navmesh and walk through geometry that the bake treated as absent.

Fix: Rebake the navmesh after every session that changes the placement of buildings, walls, terrain, or other Navigation Static geometry.

Cause 2: Wall geometry not marked Navigation Static

If a wall was added to the scene but not marked Navigation Static, the bake does not see it. The navmesh is generated through the wall as if it is not there. Zombies receive a path that crosses through the wall and follow it.

Fix: Select all walls and barriers in the scene, enable the Navigation Static flag, and rebake.

Cause 3: Agent radius too large for a doorway

If the doorway is narrower than 2× agent radius, the bake does not generate navmesh through the doorway. Zombies pathfind to the closest navmesh point to the player — which may be directly against the wall — and stand there.

Fix: Add an off-mesh link through the doorway, or reduce the agent radius if the map's overall geometry permits.

The link exists but its endpoints are in the air or inside geometry. The link is never used. Zombies cannot cross the gap and path to the nearest point, which may press them against a wall.

Fix: Use the Scene view with navmesh visualization enabled to confirm each off-mesh link endpoint is on the blue navmesh surface.

Cause 5: Navmesh generated inside walls due to thin wall geometry

Very thin wall geometry (less than 0.1 m thick) can be voxelized incorrectly, producing navmesh inside the wall volume. Zombies receive paths that route them into the wall.

Fix: Increase the wall mesh thickness to at least 0.2 m, or use a NavMeshObstacle component on the wall with Carve enabled to cut a hole in any navmesh that overlaps the wall.

The NavMeshObstacle component allows a dynamic GameObject (a vehicle, a crate that can be moved, a destructible wall) to carve a hole in the navmesh at runtime. Carving is computationally expensive and should be used sparingly.

Carve performance cost

Each NavMeshObstacle with Carve enabled triggers a partial navmesh rebake in the area around the obstacle every time the obstacle moves. On maps with more than approximately 30 active NavMeshObstacle carvers, the runtime rebake cost becomes measurable. The 57 Studios™ recommendation is to use NavMeshObstacle for large, infrequently moved obstacles (vehicles parked in roads) and to avoid it for small, frequently moved props.

NavMeshObstacle settingRecommended valueDescription
ShapeBox or CapsuleUse Box for rectangular obstacles; Capsule for vehicles.
CenterMatch object centerOffset from the GameObject's origin to the center of the obstacle.
SizeMatch object extentsThe obstacle's dimensions.
CarveEnabled for dynamic objectsEnables runtime navmesh carving.
Carve Only StationaryEnabledCarves only when the object stops moving. Reduces carve frequency for moving objects.
Carving Move Threshold0.1 mMinimum movement before a re-carve is triggered.
Carving Time To Stationary0.5 sTime the obstacle must remain still before carving.

Testing the navmesh in Unturned

The navmesh cannot be fully verified inside the Unity Editor alone. The Unity Editor's NavMesh visualization shows the baked surface, but it does not simulate Unturned™'s runtime pathfinding behavior. The verification step must be performed in Unturned™ single-player.

Single-player test procedure

  1. Export the map. The map export must include the updated NavMesh.asset file.
  2. Copy the exported map to the Unturned™ maps folder.
  3. Launch Unturned™ and load the map in single-player.
  4. Navigate to each zombie spawn region defined in the spawn tables.
  5. Approach a zombie and begin moving away from it. Observe:
    • The zombie should rotate toward the player.
    • The zombie should begin walking toward the player along a path that avoids obstacles.
    • The zombie should not walk into walls or stop at doorways.
  6. Move to different floors of multi-level buildings to test vertical pathfinding through staircases.
  7. Move behind a solid obstacle. The zombie should path around the obstacle rather than walking through it.
  8. If the zombie stands in place and does not pursue, the navmesh does not reach the zombie's spawn point.

Agent debugging in Unity

Before exporting, enable the NavMesh Agent's "Show Path" gizmo in Unity Play mode. Add a test zombie agent to the scene, enter Play mode, and move the agent's destination to different points in the scene. The gizmo draws the computed path as a line. This lets you verify path quality for specific routes before exporting.

Unturned single-player with zombie actively pathfinding around a building wall

Iterating the bake after geometry changes

Each bake against a modified scene may produce unexpected changes to previously working areas of the navmesh. The 57 Studios™ iterative bake workflow minimizes disruption:

  1. Make geometry changes in a defined, bounded area of the scene.
  2. Mark only the new or modified geometry as Navigation Static before rebaking.
  3. Rebake the full navmesh.
  4. In the Scene view, compare the navmesh coverage in the modified area against the pre-change state. Look for new gaps, unexpected coverage inside modified buildings, or off-mesh link disruptions.
  5. Test in Unturned™ single-player, focusing on the areas adjacent to the changed geometry.

Full bake is always full

The Unity NavMesh bake does not support partial baking of specific areas — every bake regenerates the full navmesh for the scene. If the bake produces different results in an area that was not changed, confirm that all Navigation Static geometry in that area is still correctly flagged.

The navmesh and zombie spawn tables are independent but must be compatible. A zombie spawn table assigns zombie types to a region; the navmesh must cover that region with walkable surface, or the zombies will have no path and will stand in place.

The required condition is: every zombie spawn point in the Level Editor must be placed on or within a few meters of valid navmesh surface. Spawn points that are placed in the air, inside buildings (where the navmesh does not reach), or in areas where the bake produced no coverage will produce zombies that do not move.

After baking, use the Level Editor to inspect each zombie spawn point's position relative to the navmesh visualization. Any spawn point that is not on blue surface needs to be relocated, or the navmesh bake settings need to be adjusted so coverage reaches it.

See Spawn Tables for the zombie spawn point configuration and region density settings that work in conjunction with the navmesh.

Appendix A: Navmesh bake settings field reference

FieldLocation in Navigation windowTypeDefaultDescription
Agent RadiusBake tabfloat (m)0.5The minimum width of a walkable gap (gap must be ≥ 2× radius).
Agent HeightBake tabfloat (m)2.0The minimum clearance height for a walkable surface.
Max SlopeBake tabfloat (°)45The steepest terrain slope that is walkable.
Step HeightBake tabfloat (m)0.4The maximum height of a single traversable step.
Drop HeightBake tabfloat (m)0Maximum height of a ledge the agent can drop from (requires off-mesh link for nonzero values).
Jump DistanceBake tabfloat (m)0Maximum horizontal gap the agent can jump across (requires off-mesh link for nonzero values).
Min Region AreaAdvancedfloat (m²)2Navmesh islands smaller than this area are removed.
Height MeshAdvancedboolfalseGenerates an accurate vertical surface mesh for slope-accurate agent positioning.
Voxel SizeAdvancedfloat (m)Agent Radius / 3Resolution of the voxelization pass. Smaller = more detail, longer bake.
Tile SizeAdvancedint (voxels)256The size of each navmesh tile. Smaller tiles improve incremental carve performance.

Appendix B: Bake failure diagnostic table

SymptomMost likely causeResolution
Navmesh covers area inside a wallWall geometry too thin for voxelizerIncrease wall mesh thickness to ≥ 0.2 m, or add NavMeshObstacle with Carve
Navmesh does not reach a doorwayDoorway narrower than 2× agent radiusAdd off-mesh link through the doorway
Navmesh does not reach a staircase landingStep height exceeds agent Step Height settingIncrease Step Height, or add off-mesh link from bottom to top of staircase
Entire rooftop is uncoveredRooftop geometry not marked Navigation StaticMark rooftop geometry Navigation Static and rebake
Small navmesh islands throughout the sceneMin Region Area too lowIncrease Min Region Area to remove tiny disconnected patches
Bake produces no navmesh at allNo geometry in scene is marked Navigation StaticMark terrain and all buildings Navigation Static
Off-mesh link not appearing in visualizationLink endpoints not on valid navmeshReposition endpoints onto blue navmesh surface and rebake
Navmesh disappears in a section after rebakeNavigation Static flag removed from geometry during a prefab updateRe-mark affected geometry Navigation Static
Zombies fall through terrain on spawnSpawn point positioned below navmesh surfaceRaise spawn point to ground level, within 0.5 m of navmesh
Bake time exceeds 30 minutesVoxel size too small for map areaIncrease voxel size to 0.2 m and rebake

Use the following checklist when placing off-mesh links for a building:

  • [ ] All exterior doorways have a bidirectional off-mesh link with endpoints 0.5 m from the door frame.
  • [ ] All interior doorways connecting different navmesh regions have bidirectional links.
  • [ ] Each staircase has a bidirectional off-mesh link from bottom landing to top landing.
  • [ ] Each window opening that players can exploit as a zombie entry point has an off-mesh link.
  • [ ] Drop-down ledges (rooftop to ground, upper story to lower story) have one-way links pointing downward.
  • [ ] Each link's Start and End transforms are on visible blue navmesh surface in the Scene view.
  • [ ] Each link's Activated flag is enabled.
  • [ ] Bidirectional links have Bidirectional enabled; one-way links do not.
  • [ ] After adding links, the scene has been saved and the navmesh has been rebaked.
  • [ ] After rebake, each link appears as an arc in the navmesh visualization.

Frequently asked questions

Why do zombies stand in place and never pursue the player?

The most likely cause is that no navmesh exists at or near the zombie's spawn point. The zombie AI calculates a path to the player's position at spawn time. If the spawn point is not within reach of the navmesh, the engine returns a no-path result and the zombie remains stationary. Verify by enabling the navmesh visualization in the Unity Editor and confirming the spawn point position is on or adjacent to blue navmesh surface.

My navmesh bake takes over 10 minutes. Is there a way to speed it up?

The primary factor is the voxel size setting in the Advanced panel. The default voxel size is Agent Radius / 3. Increasing the voxel size to Agent Radius / 2 reduces bake time significantly (roughly by a factor of four) at the cost of reduced navmesh detail. For a 1024×1024 map, an Agent Radius of 0.4 m and a voxel size of 0.2 m typically produces a bake under 3 minutes while retaining sufficient accuracy for standard Unturned™ map geometry.

Can I have different navmesh agent types for different zombie variants?

Yes. Unity supports multiple agent types defined in the Navigation window's Agents tab. Each agent type has its own radius, height, slope, and step height settings, and each requires a separate bake pass. In practice, most Unturned™ map projects use a single agent type for all zombie variants because the bake overhead for multiple agent types is significant and the behavioral difference between agent types is subtle.

Zombies can reach the player on the ground floor but not on the upper floor. What is wrong?

The most likely cause is missing off-mesh links on the staircase. The bake generates flat navmesh on each floor level but does not automatically connect them through staircases. Add a bidirectional off-mesh link from the bottom landing to the top landing of every staircase and rebake.

The navmesh covers the inside of my building but not the roof. How do I add rooftop coverage?

Select the roof geometry in the Unity Hierarchy and enable Navigation Static. The roof mesh surface must be face-up (normals pointing upward) for the bake to treat it as walkable. Geometry with normals pointing downward is treated as a ceiling, not a floor, and no navmesh is generated. If the roof mesh has inverted normals, flip them in Blender before re-importing the FBX.

How do I make a specific area completely unwalkable?

Select the geometry in that area and add a NavMeshObstacle component. Enable Carve. The bake will cut a hole in the navmesh over the obstacle. For static geometry (a permanently impassable fence, a wall), the 57 Studios™ recommendation is to remove the Navigation Static flag from the blocking geometry rather than adding a NavMeshObstacle — the bake will not generate navmesh over geometry that is not Navigation Static.

Can players interact with the navmesh at runtime?

No. Players are controlled directly by physics input and do not use the NavMesh system. The NavMesh is consumed exclusively by AI agents (zombies, animals). Player movement is not affected by navmesh coverage or gaps.

Will updating the navmesh affect an already-running server?

The navmesh is loaded when the map bundle is loaded at server start. A navmesh update requires redistributing the updated map bundle and restarting the server. There is no mechanism to hot-reload the navmesh without a server restart.

Adding new buildings to the scene and rebaking the navmesh may have partially overwritten the navmesh in the area around the buildings, disconnecting previously connected navmesh regions. After adding geometry and rebaking, inspect all off-mesh links in the affected area. Links whose endpoints are on navmesh regions that are now separated need to be extended or repositioned.

How do I bake navmesh for an underground bunker or cave?

Underground spaces must have their geometry marked Navigation Static and must have at least one off-mesh link connecting the underground space to the surface navmesh (the entrance/exit). If the entrance is a vertical shaft, use a one-way link downward from the shaft opening to the bunker floor, and a separate one-way link upward from the bunker floor to the shaft opening. The bake generates navmesh on every flat surface that is marked Navigation Static, regardless of depth.

Zombies pursue the player into water and drown. How do I prevent this?

Water surfaces are typically not marked Navigation Static and do not have navmesh. The issue is that the zombie's last valid path to the player terminates at the water's edge, but the zombie's momentum carries it into the water. This is an Unturned™ engine behavior rather than a bake issue. The mitigation is to add a NavMeshObstacle carver over deep water areas or to use invisible barrier geometry at the water's edge marked Navigation Static to create a wall in the navmesh.

Can I use a manually authored navmesh mesh instead of the Unity bake?

No. Unturned™ uses Unity's NavMesh system exclusively and expects the NavMesh.asset file format that the Unity Editor bake produces. Hand-authored navmesh data in a different format is not compatible.

Cross-references

Document history

VersionDateAuthorNotes
1.02026-05-1857 Studios™Initial publication. Agent settings, bake workflow, off-mesh links, wall-walking diagnostics.