NavRegion
A rectangle of the world that can be walked, baked into a grid for pathfinding. An enemy or a patrol finds a route across it that a Nav Obstacle can block outright and a Nav Cost can only make pricier.
On this page
Add it
+ Add node → Nav Region creates a node with it already on. Already have a node for it? Add component → NavRegionComponent.
From a script
A script on the same node writes these fields by name. NavRegionComponent is the name to pass.
rgs
set_point("NavRegionComponent", "size", vec2(640.0, 360.0));
set_number("NavRegionComponent", "cell_size", 16.0);
set_flag("NavRegionComponent", "diagonals", true);
set_number("NavRegionComponent", "clearance", 0.0); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Size | size | two numbers (x, y), at least 1 | (640, 360) | Size of the walkable rectangle in world units. |
| Cell Size | cell_size | number, at least 1 | 16 | How big one navigation cell is, in world units. |
| Allow Diagonals | diagonals | checkbox | on | Whether an agent may move diagonally. |
| Mask | mask | number | -1 | Which collider layers block this region. |
| Clearance | clearance | number, at least 0 | 0 | How far walkers keep from walls; half a walker's width keeps it off them, under half a cell keeps narrow corridors open. |