godot-enemy-ai

Build a Godot 4.6 enemy AI with patrol, chase, and attack states.

8|3|Updated Jun 12, 2026
One-click install
npx skills add https://github.com/arthur0n/xenodot-forge --skill godot-enemy-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: godot-enemy-ai
Source: https://github.com/arthur0n/xenodot-forge/tree/main/plugin/skills/godot-enemy-ai
Command: npx skills add https://github.com/arthur0n/xenodot-forge --skill godot-enemy-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create a native Godot 4.6 enemy AI that can patrol waypoints, detect the player, navigate around obstacles, and switch between behaviour states without relying on third-party AI addons.

Core Features & Use Cases

  • Native Navigation: Uses NavigationRegion3D and NavigationAgent3D for real 3D pathfinding and avoidance.
  • Node-Based FSM: Organizes patrol, chase, and attack behavior into reusable state nodes composed onto a CharacterBody3D.
  • Perception Seams: Supports detection range plus line-of-sight checks for enemies that aggro only when appropriate.
  • Practical Use Cases: Build guards, monsters, or NPC enemies that walk routes, react to the player, and recover from common navmesh and spawn-time pitfalls.

Quick Start

Use this skill to implement a Godot enemy that patrols Marker3D waypoints, chases the player when seen, and attacks on cooldown using the provided native navigation and state machine pattern.

Frequently Asked Questions about godot-enemy-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a Godot enemy patrol waypoints and chase the player without third-party AI addons?

You can build native Godot enemy AI by composing a node-based finite state machine onto a CharacterBody3D, using reusable state nodes for patrol, chase, and attack behaviors that navigate waypoints and react to the player without third-party addons.

How does NavigationAgent3D pathfinding work for enemy chasing in Godot 3D games?

NavigationAgent3D handles enemy chasing by calculating paths around obstacles on a baked NavigationRegion3D, providing real 3D pathfinding and avoidance for enemies pursuing the player across the navmesh.

How do I set up line-of-sight detection for enemy aggro in Godot?

Line-of-sight aggro in Godot is set up using detection range checks combined with ray-based line-of-sight validation, ensuring enemies only trigger chase behavior when the player is within range and visually unobstructed.

Do I need a baked NavigationRegion3D to use this enemy AI state machine?

Yes, a baked NavigationRegion3D is required. The enemy AI relies on native Godot navigation, so the navmesh must be generated and baked in your 3D scene before NavigationAgent3D can compute patrol routes or chase paths.

What is the best way to structure enemy behavior states in Godot GDScript?

The best way to structure enemy behavior in Godot is a node-based finite state machine. Separating patrol, chase, and attack logic into individual state nodes composed onto a CharacterBody3D keeps behaviors modular, reusable, and strictly typed in GDScript.

Why does my Godot enemy AI get stuck on navmesh obstacles during pursuit?

Enemies get stuck during pursuit when the NavigationRegion3D is not properly baked or NavigationAgent3D avoidance settings are misconfigured. Ensuring the navmesh covers patrol waypoints helps recover from common navigation pitfalls.