NavCost
A rectangle that is walkable but costs more to cross than open ground: spikes an enemy crosses only when there is no other way, shallow water that slows a patrol. Not a wall — the search still takes it once the detour costs more.
On this page
Add it
+ Add node → Nav Cost creates a node with it already on. Already have a node for it? Add component → NavCostComponent.
From a script
A script on the same node writes these fields by name. NavCostComponent is the name to pass.
rgs
set_point("NavCostComponent", "size", vec2(64.0, 64.0));
set_number("NavCostComponent", "cost", 3.0);
set_flag("NavCostComponent", "enabled", true); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Size | size | two numbers (x, y), at least 1 | (64, 64) | Size of the priced rectangle in world units. |
| Cost | cost | number, at least 0.01 | 3 | How many times pricier this ground is than ordinary ground. |
| Enabled | enabled | checkbox | on | Whether it is priced right now. |