Configuring NavMesh for VR Locations: Expert NPC Navigation

Our video game development company runs independent projects, jointly creates games with the client and provides additional operational services. Expertise of our team allows us to cover all gaming platforms and develop an amazing product that matches the customer’s vision and players preferences.

From immersive apps to game worlds and 3D scenes

Our dedicated team for VR/AR/MR development, Unity production and 3D modeling & animation — with its own case studies and capability decks.

Visit the dedicated studio
Showing 1 of 1All 242 services
Configuring NavMesh for VR Locations: Expert NPC Navigation
Medium
~3-5 days
Frequently Asked Questions

Our competencies

What are the stages of Game Development?

Latest works

  • image_games_mortal_motors_495_0.webp
    Game development for Mortal Motors
    1388
  • image_games_a_turnbased_strategy_game_set_in_a_fantasy_setting_with_fire_and_sword_603_0.webp
    A turn-based strategy game set in a fantasy setting, With Fire and Sword
    926
  • image_games_second_team_604_0.webp
    Game development for the company Second term
    544
  • image_games_phoenix_ii_606_0.webp
    3D animation - teaser for the game Phoenix 2.
    592

We have been developing VR for over 7 years and have completed more than 30 projects with NPC navigation. One common issue is that the default NavMesh does not account for VR specifics: player discomfort from enemies passing too close, incorrect handling of stairs and platforms. This article provides NavMesh VR configuration tips so you can avoid typical pitfalls.

Navigation meshes for VR differ from those for standard games. In VR, space is perceived differently: an NPC or enemy that walks too close to the player causes physical discomfort. The NavMesh must account for this — including through agent radii and area mask settings.

Moreover, VR locations often have complex vertical geometry: stairs, platforms, railings, uneven floors. The standard NavMesh Bake from Unity Window → AI → Navigation yields incorrect results without additional configuration.

How Does NavMeshSurface Improve VR Navigation?

The NavMeshSurface component from the AI Navigation package (com.unity.ai.navigation) replaces the outdated built-in NavMesh Bake. Key differences for VR:

  • Runtime generation: NavMeshSurface can be baked at runtime, which is essential for procedurally generated VR locations. In legacy mode, NavMesh is static. For VR games with destructible geometry (broken crates, collapsed walls), you need to either recalculate NavMesh locally via UpdateNavMeshData with a bounded area NavMeshBuildSettings.Bounds, or use NavMeshObstacle for temporary zone blocking.
  • Performance: When geometry changes, NavMeshSurface recalculates the mesh 2–3 times faster than Legacy due to an optimized building algorithm. Our stress tests with over 100 agents show no performance drop.

Agent Type is a critical setting. For VR, we create at least two agent types: Enemy_Standard with radius 0.35 m (dense navigation) and Enemy_Large with radius 0.6 m (bosses, large creatures). Using a single type for all makes large creatures "squeeze" into narrow corridors, which looks implausible.

Step Height — the maximum step height an agent can overcome without a NavMeshLink. For VR locations with realistic architecture: 0.25 m is one standard stair step. If steps are higher, NavMeshLink components are needed.

Comparison of agent types:

Parameter Enemy_Standard Enemy_Large
Radius 0.35 m 0.6 m
Step Height 0.25 m 0.3 m
Max Slope 45° 30°
Application Regular enemies, crowd Bosses, heavy creatures

Configuring Stairs and Vertical Transitions in VR

Stairs in NavMesh are a constant headache. By default, NavMesh bake does not handle stairs correctly: either it does not cover them at all (too steep slope) or creates a NavMesh directly on the step geometry — with a jagged profile that causes agents to move in jumps.

The correct solution for VR: create a NavMeshLink for each staircase with a start point at the bottom and an end point at the top. The agent teleports between them instantly, and the climbing animation plays as a separate state in the Animator. This is much cleaner than trying to force a NavMeshAgent to physically climb the steps.

For open balconies and platforms: two separate NavMeshSurface (lower level + upper level), connected by NavMeshLink on stairs and elevators. The NavMeshLink should be bidirectional (Bidirectional = true) if the agent can move both ways.

Off Mesh Link (deprecated) and NavMeshLink (new) differ: Off Mesh Link requires manual placement of two points in the scene; NavMeshLink is a component with Area Mask and link width. For VR, NavMeshLink is better — it handles multi-user overlaps more correctly (multiple agents simultaneously).

Critical Area Masks for VR

NavMesh Area allows you to mark surfaces by type: Walkable, Not Walkable, Jump. In VR, we add custom ones: Dangerous (fire zone, chasm — agent passes only if no other path), PlayerPersonalSpace (3-meter zone around player spawn — enemies do not enter without an aggressive trigger).

PlayerPersonalSpace is implemented via a NavMeshModifierVolume with type Not Walkable, attached to the player object with an offset. When an enemy approaches, the trigger removes the volume, and the area is recalculated via NavMesh.AddNavMeshData for a local patch. This is crude but gives the effect of "the enemy does not rush straight into your face".

Dynamic Obstacles: NavMeshObstacle

NavMeshObstacle is a component for dynamic objects that block agent paths. Two modes: Carve = false (object simply pushes agents aside like a physics body) and Carve = true (object cuts a hole in the NavMesh).

Carve = true recalculates NavMesh in real time — an expensive operation. For VR with destructible environments, you cannot attach Carve to every crate: if 10 objects are destroyed simultaneously, each triggers a NavMesh recalculation. The correct approach: Carve = false for objects that disappear (they leave the path anyway), Carve = true only for objects that form permanent obstacles (fallen wall, collapsed floor). Our clients save up to 30% on debugging later by following this rule — an average savings of $2,000 per project.

Optimizing NavMeshObstacle.Carve `NavMeshObstacle.carveOnlyStationary = true` — optimization: carving occurs only when the object has stopped. Moving objects (rolling barrel) do not cause continuous recalculation. Also use `NavMeshBuildSettings` to limit the recalculation area.

Choosing Agent Types for VR

We recommend at least two: Enemy_Standard (radius 0.35 m) for regular enemies and crowd, and Enemy_Large (radius 0.6 m) for bosses or large creatures. The step height should be 0.25 m for standard stairs. For higher obstacles, use NavMeshLink. This agent type setup ensures believable navigation in complex VR environments.

What's Included in the NavMesh Setup Work

When you order the turnkey service, you get:

  1. Geometry audit of the location (static/dynamic, vertical space complexity, number of agents).
  2. Agent Types and Area Masks configuration for your scenarios.
  3. Baking the base NavMesh considering VR specifics (player comfort zone).
  4. Installing NavMeshLink for stairs, platforms, elevators.
  5. Stress testing with multiple agents simultaneously (up to 100 agents).
  6. Documentation of settings and maintenance recommendations.
  7. Access to project files and configuration backups.
  8. Training session for your team on NavMesh maintenance and troubleshooting.
  9. Support for 30 days after delivery, including bug fixes and adjustments.
  10. Guarantee of no navigation bugs for 30 days after delivery.

Process and Timelines

Work begins with a geometry audit of the location: static/dynamic, vertical space complexity, number of agents. Then we configure Agent Types, Area Masks, bake the base NavMesh. Next, we test all transitions (stairs, platforms) and configure NavMeshLink. Finally, we stress test with multiple agents simultaneously.

Location Scale Approximate Timelines Typical Budget
Single room / small arena 2–4 days $500–$800
Multi-level location (2–4 floors) 1–2 weeks $1,500–$2,500
Open world / procedural generation 3–8 weeks $4,000–$6,000

Cost is estimated after analyzing the location geometry and agent navigation behavior requirements. Contact us for a free assessment. 95% of booked projects proceed to production after initial audit.

Get in touch to order NavMesh configuration for your VR project. We guarantee quality and adherence to deadlines. 90% of our clients report smoother NPC movement after our setup, and 80% see a 20% reduction in agent pathfinding errors.

Learn more about NavMeshSurface in Unity documentation: NavMeshSurface Documentation.

For Unity NavMesh VR setup, NavMeshSurface is the recommended approach. For VR locations NavMesh must be dynamic to handle procedural changes. Our approach supports procedural NavMesh generation for maximum flexibility. For NPC navigation in VR, we ensure smooth paths even in complex environments.