Navmesh
Walkable areas as polygons instead of tiles.
Grids make agents walk in jagged tile steps and waste memory on big open spaces. A navigation mesh describes where you can walk as a few convex polygons. Pathfinding runs over polygons, then the path is pulled tight around corners so agents walk in straight lines like people do.
Try this: Click or tap anywhere to send the hero. Without a navmesh he walks straight at the flag and gets stuck on a wall. Turn the navmesh on: he follows the walkable area around corners.
Straight line: the hero walks into the wall and gets stuck.
Prompt bit
Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.
Where it's used
- 3D action and RPGs: enemies chasing over terrain
- RTS and MOBAs: click-to-move units
- Open worlds: NPCs walking between places
- Stealth games: guards patrolling and searching
- Big 2D maps: polygon navigation instead of huge grids
Common mistakes
Baking without the agent radius so agents scrape walls, following polygon centres so paths zigzag, re-pathing every frame, destinations off the mesh that silently fail, and forgetting to update the mesh when doors open.
Writing this with an AI assistant? See our best AI coding assistants for game developers.
Missing a concept? Request one.



