> For the complete documentation index, see [llms.txt](https://megacrush.gitbook.io/megacrush-unity-assets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://megacrush.gitbook.io/megacrush-unity-assets/runtime-navmesh-baker/runtime-navmesh-baker-user-manual/package-elements/scriptable-objects/navmeshbakeprofile.md).

# NavMeshBakeProfile

## Runtime Navmesh Baker — Bake Profile

The **Bake Profile** (ScriptableObject) configures how the runtime baker chooses bounds, collects sources, throttles work, and stitches seams.\
Assign a profile to your **BakerCoordinator / NavMeshBakerService** to control runtime baking.

Create one via:\
`Assets → Create → Runtime Navmesh Baker → Bake Profile`

***

### What profiles are good for

* Keep multiple configurations (e.g., Open World, Dungeon, Arena).
* Tune behavior without changing code.
* Share consistent settings across scenes.

<figure><img src="/files/I0qpqDxDFkF6zYOMRGIh" alt=""><figcaption></figcaption></figure>

### Overview

* **Bake Mode** – Continuous AABB, Grid Cells, or One Shot
* **Update Triggers** – follow target & poll cadence (where applicable)
* **Continuous AABB** – moving AABB “bubble”
* **Grid Cells (Window)** – fixed-size cell window
* **One Shot** – bake the entire scene once at startup
* **Motion Gating** – optional speed gates
* **Concurrency & Throttling** – job limits
* **Source Collection** – geometry/layers/default area
* **Agent Types & Area Costs** – per-area traversal
* **Seam Links** – optional links across tile edges

***

### Inspector Reference

#### Mode

**Bake Mode**

* **Continuous AABB** – moving bounding box around target.
* **Grid Cells** – rings of fixed cells around target (3×3, 5×5, …).
* **One Shot** – bake a single large navmesh covering the entire scene once at runtime.

***

#### One Shot

Use **One Shot** when you want a full navmesh built once at startup, without continuous or incremental updates.

**Settings**

* **Base Bounds Size (XYZ)** – defines the full extents of the bake volume (should cover your whole map).
* **Auto Start** – if true, begins baking automatically at runtime.
* **Trigger Mode** –
  * *Manual*: call `BakerCoordinator.EnqueueBake()` to start the one-shot bake.
  * *Auto*: bake starts immediately on Awake/Start.
* **Rebake Behavior** –
  * Default: no rebakes scheduled.
  * Optional: expose manual rebake events if the map changes dynamically.

**Notes**

* Works best for large handcrafted maps where the navmesh doesn’t need to stream or follow a player.
* Use `OnBakeCompleted` to synchronize agent spawning after the one-shot bake finishes.
* Consider memory usage: the entire navmesh is generated in a single data set.

***

#### Continuous AABB

* **Move Threshold (m)** – re-bake after the center moved this far.
* **Base Bounds Size (XYZ)** – AABB size around the center.
* **Moving Rebake Interval (s)** – minimal time between moving bakes.
* **Use Velocity Lead / Velocity Lead (m)** – bias AABB in the motion direction.
* **Edge Rebake Margin (m)** – re-bake if center nears the edge of last AABB.

***

#### Grid Cells (Window)

* **Cell Size XZ (m)** – cell dimensions on X/Z.
* **Cell Height (m)** – vertical extent of each cell.
* **Cell Rings** – rings around current cell (0 = current; 1 = 3×3; 2 = 5×5).
* **Cell Rebake Interval (s)** – minimal time between cell updates.
* **Cell Hysteresis (0–0.9)** – “stickiness” to avoid thrashing near borders.
* **Window Y Slab Height (m)** – vertical slab baked for the window.
* **Window Overlap Padding (m)** – extra XZ padding for polygon overlap.
* **Quantize Window To Voxel** – align window to voxel grid to reduce cracks.

***

#### Concurrency & Throttling

* **Max Concurrent Bakes** – upper bound for parallel jobs.
* **Min Seconds Between Bakes / Surface** – per-surface throttle. In combined mode, applies globally per-agent.

***

#### Source Collection

* **Collect Geometry** – Physics Colliders / Render Meshes.
* **Layer Mask** – included layers.
* **Default Area** – fallback NavMesh area index for collected sources.

***

#### Agent Types & Area Costs

* **Agent Type IDs** – explicit agent types to bake (empty = use each surface’s agent type).
* **Area Costs \[0..31]** – per-area traversal costs (-1 leaves unchanged).

***

#### Seam Links (Tile Edge Portals)

(unchanged; applies only when Grid Cells + Combine Tiles = OFF)

***

### Best Practices

* **One Shot** for handcrafted maps where you want the navmesh built once at runtime.
* **Continuous AABB** for compact maps or “bubble around player” setups.
* **Grid Cells** for streaming/procedural worlds; add Seam Links if not combining tiles.
* Keep **pollRateSeconds** between 0.1–0.25 s for responsive updates without spikes.
* Cap **maxConcurrentBakes** to match CPU budget.
* Use **areaCosts** to nudge pathing (e.g., roads cheaper, hazards more expensive).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://megacrush.gitbook.io/megacrush-unity-assets/runtime-navmesh-baker/runtime-navmesh-baker-user-manual/package-elements/scriptable-objects/navmeshbakeprofile.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
