reckfellENGINE

2D navigation: choose a system and start moving

From a route model to physics movement and goal validation.

On this page

Start by choosing a route model. Navigation finds paths, game code moves characters, and physics checks collisions. Having one system does not create the other two.

Choose an API

TaskClass / API
Predefined points and connectionsAStar2D.
Movement between rectangular-grid cellsAStarGrid2D.
Movement inside arbitrary traversable surfacesNavigationServer2D with a map and polygons.
Convenient parent path-following supportA child NavigationAgent2D; you still implement physics movement.

Do not choose a mesh merely because it sounds more powerful. A grid can express turn-based rules more precisely. Free movement on a surface does not require manually placing a graph point at every possible position.

Surface-movement workflow

  1. Prepare a NavigationPolygon containing actual polygons and assign it to NavigationRegion2D. For a programmatic example, see square baking.
  2. Ensure the region and character use the same map. Assign a custom map explicitly to the agent; see maps and ownership.
  3. Create a CharacterBody2D and CollisionShape2D. The collider serves physics; the navigation resource serves pathfinding.
  4. Add a child NavigationAgent2D. Use the executed agent example for a complete script, exact child name and shape.
  5. After navigation publication, call that example's SetDestination with a global goal.
  6. Check movement, goal arrival and stopping. Then request a goal outside the surface and handle the partial route separately.

On the checked x=0–20, y=0–10 map, the physics body moved from (2, 5) to (18, 5). Goal (30, 5) was unreachable even though the agent finished its available route. These are distinct outcomes, rather than one IsNavigationFinished() check.

Objects you actually need

NavigationPolygon stores surface data. NavigationRegion2D places it on a map. The map combines regions for queries. NavigationAgent2D helps select the next point and optionally computes avoidance. CharacterBody2D performs physics movement through your code.

NavigationLink2D represents a special transition but does not execute a jump or teleport. NavigationObstacle2D participates in avoidance and/or bake-source parsing; adding one does not automatically update prepared paths. Add these Entities only when the task requires them.

Diagnose no movement

  • No path: inspect polygons, map, layers and navigation readiness.
  • A path exists but the body stands still: implement parent movement; the agent does not move it.
  • A wall stops the body: align navigation and collision geometry. The checked collider blocked movement despite a straight route through it.
  • Movement is too slow: supply MoveAndSlide() velocity in units per second without multiplying by delta again.

Continue with agents, regions, then area access.

The linked 2D example executes physics movement, stopping, partial-route and wall scenarios. AStar class selection was checked against SDK/source; its algorithms, editor-level setup and visual output were not evaluated by this check.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.