Skills

AI Navigation

Use when implementing AI movement, NavigationAgent2D/3D, steering behaviors, behavior...

Install

npx skills add jame581/GodotPrompter --skill ai-navigation -g -a claude-code -y
Category
Media
Updated
3d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Use when implementing AI movement, NavigationAgent2D/3D, steering behaviors, behavior trees, and patrol patterns

AI Navigation in Godot 4.3+

Cover NavigationAgent2D/3D, steering behaviors, behavior trees, and patrol patterns. All examples target Godot 4.3+ with no deprecated APIs.

Related skills: state-machine for AI state management, component-system for modular AI behaviors, player-controller for movement physics patterns, math-essentials for pathfinding vectors and steering math, limboai for BT + HSM with a visual editor, beehave for lightweight GDScript behavior trees. For a structured behavior tree (rather than steering/navigation), see the comparison tables in limboai and beehave.


1. Navigation Setup

Scene Structure

World (Node2D or Node3D)
└── NavigationRegion2D (or NavigationRegion3D)
    ├── TileMapLayer / StaticBody2D (geometry)
    └── Enemy (CharacterBody2D with NavigationAgent2D child)

NavigationRegion2D / NavigationRegion3D

  1. Add a NavigationRegion2D (or NavigationRegion3D) node to your scene.
  2. Assign a NavigationPolygon (2D) or NavigationMesh (3D) resource to it.
  3. Draw the walkable area in the NavigationPolygon editor, or configure the NavigationMesh bounds in 3D.
  4. Bake the mesh at edit time: select the NavigationRegion node → click Bake NavigationPolygon (2D) or Bake NavigationMesh (3D) in the toolbar.
  5. Bake at runtime when the world changes dynamically:
# 2D
$NavigationRegion2D.bake_navigation_polygon()

# 3D
$NavigationRegion3D.bake_navigation_mesh()
// 2D
GetNode<NavigationRegion2D>("NavigationRegion2D").BakeNavigationPolygon();

// 3D
GetNode<NavigationRegion3D>("NavigationRegion3D").BakeNavigationMesh();

Async Navigation Baking

Read the whole SKILL.md on GitHub

More in Media