VaelisDocs
v1.0.0
Components · v1.0.0

NavWorld2D

Vaelis 1.0.0 NavWorld2D component reference: fields, script API, behavior and examples.

View as Markdownllms.txt
ScopeThis page documents the NavWorld2D component in Vaelis 1.0.0. Runtime fields are serialized scene data; the Script API section lists only members intentionally exposed to game scripts.
Where to find it in the editorTop GameObject → 2D Object → Nav World 2D. Once present, toolbar U/I/O brushes and Bounds/Cells view controls appear. Configure named areas with Edit → Nav Areas….

#What it does

Shared navigation world for baked or dynamic 2D pathfinding, with 16 navigation areas.

Component setup & editor toolsNavWorld2D owns the navigation world/bake configuration used by NavAgent2D and the navigation API.

#How to add and use NavWorld2D

Editor path: Select the target entity in the Hierarchy (left side) → look at the Inspector (right side) → click Add Component at the bottom of the Inspector → search for NavWorld2D → click the component row. The Add Component picker is a centered modal with a search box; it only lists components not already attached.

For components with a dedicated editor tool, the tool is opened or activated from the location described below. Do not assume that adding the component alone activates its editor; some systems require a separate window, panel, or viewport tool.

#Component setup & editor tools

  • Select/create an entity → Inspector → Add Component → Nav World 2D. Use the Navigation toolbar and Edit → Nav Areas… controls to define/bake the navigation world; then connect agents to it through the documented navigation workflow.

#What you should see after adding it

The component appears as its own section in the Inspector. Its serialized settings are listed in the Component data table below. If a field is conditional, it appears only when the relevant mode/type is selected. If a field is a runtime state field (for example grounded or resolved velocity), treat it as read-only diagnostic state unless the API reference explicitly documents it as writable.

#How to read the settings

For every setting below, the documentation distinguishes type, default, meaning, and tuning direction where behavior is known. When a value represents a direction, use the engine's coordinate convention documented in Coordinate system; do not substitute Unity/Godot conventions.

#Component data

FieldTypePurposeDefault
boundsXnumberWorld-space bounds X.-400
boundsYnumberWorld-space bounds Y.-400
boundsWidthnumberBounds width.800
boundsHeightnumberBounds height.800
cellSizenumberNavigation cell size.32
cellssparse mapAuthored filled cells.{}
bakedCellsdata|nullDerived baked representation.null
paintOverridessparse mapExplicit walkability overrides.{}
cellAreassparse mapPer-cell area assignment overrides.{}
areaCosts16-entry array|nullTraversal cost multipliers.null
allowDiagonalbooleanAllow diagonal A* connections.false
dynamicbooleanRebuild from dynamic scene obstacles.false
minObstacleFootprintnumberMinimum obstacle footprint used for baking.0

#Tuning behavior

These are the practical direction-of-change rules for the most important controls on this component.

SettingWhat changing it does
cellSizeSmaller cells give a finer grid and can represent narrower corridors, but increase navigation work/memory.
allowDiagonalOff means 4-neighbor movement; on adds diagonal connections.
dynamicWhen enabled, navigation can be rebuilt dynamically from current geometry; use only when runtime rebaking is actually needed.
areaCosts1 means neutral cost; 3 makes an allowed area approximately three times as expensive to traverse. Cost is preference, not a hard exclusion.

#Script API

MemberKindDescription
nav.findPath()GlobalFind world-space path through a NavWorld2D.
nav.isWalkable()GlobalCheck a world-space point.
nav.bake()GlobalBake navigation data after authored changes.
nav.areaIndexPropertyCurrent/selected navigation area index surface.
nav.areaMaskPropertyNavigation area mask.
nav.areaCostsPropertyNavigation area costs.

#Notes & behavior

  • NavWorld2D is a scene component; there is no `this.navWorld` object. Scripts use the global `nav` module.
Need the full workflow?Components: complete workflow covers adding, configuring, testing, combining, and removing components.