A navigation mesh is where agents can walk in a room, as convex polygons. Paths over it go straight across open floor and hug corners, instead of following a grid. Open a room and choose Code > Kit > Navigation Mesh > Edit Navigation Mesh (⌃⇧⌘9); the room inspector's Navigation section has the same tools.
- Walkable Area (⌥⇧⌘6): click the points of an area agents can walk; click the first point (or double-click) to finish.
- Hole (⌥⇧⌘7): click the points of a hole in an area (a pond, a pillar, a table).
- Link (⌥⇧⌘8): click where a jump or drop starts, then where it lands (see "Jump and drop links").
- Select (⌥⇧⌘5): click an area, hole or link; drag its points, ⌥-click a point to remove it, click a side's middle dot to add one. Delete Navigation Shape (⌃⇧⌘0) removes it.
- Test Path (⌥⇧⌘0): click a start and a goal; the path
nav_path()will find is drawn, or the goal turns red when there is no way. - Bake from Collision (⌃⇧⌘8): builds the mesh from the room's collision layers, tile shapes, static bodies, collision shapes and solid objects, grown by the Agent radius so agents keep clear of walls. Drawn areas limit it to themselves; with none, the whole room is used. Collision mask picks the collision layers that block.
- Show Navigation Mesh (⌃⇧⌘7) draws the polygons over the room when not editing.
Every edit is one undo step. The mesh is kept in .studio/navmesh/<room>.json and written into the generated script scr_studio_navmesh, so GameMaker builds the game as it is.
Related topics
Keys are shown as on the Mac: ⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift. Studio for Windows shows its own keys beside each menu item.