Skip to content

NavGrid Apply Tile Costs

Applies per-tile traversal costs to a NavGrid from a tilemap using explicit tile mappings.

Parameter Description
NavGrid NavGrid to modify.
Tilemap Tilemap to read tiles from.
Mappings Tile-to-cost mappings to apply.
Apply Default For Unmapped If true, uses Default Cost for tiles not in mappings.
Default Cost Cost used for unmapped tiles when default is enabled.
Only Walkable If true, only writes cost on walkable cells.
Write Mode How to combine with existing cost (Set, Add, Max, Min).

Example

  1. Map MudTile to higher cost and RoadTile to lower cost.
  2. Set Write Mode to Max so costs only increase where needed.
  3. Run before pathfinding so A* can prefer cheaper routes.

See also