# Bevy AI Navigation

Bevy 0.20 chase, patrol, and wait policy: an enum brain, a goal, a desired velocity...

- Repository: https://github.com/thedivergentai/Game-Dev-Agentic-Skills (917 stars)
- Category: Engineering
- License: LGPL-3.0
- Last updated: 2026-10-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ai-navigation -g -a claude-code -y`
Codex: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ai-navigation -g -a codex -y`
Cursor: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ai-navigation -g -a cursor -y`
Gemini CLI: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ai-navigation -g -a gemini-cli -y`

## Description

Bevy 0.20 chase, patrol, and wait policy: an enum brain, a goal, a desired velocity, and a retarget timer on FixedUpdate. Use when an actor must choose a goal before movement. Paths stay on bevy-navigation. Keywords: Brain, Goal, DesiredVelocity, PatrolRoute, FixedUpdate, chase, patrol.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Bevy AI navigation

## When to use

Load this when an actor must chase, patrol, or wait. This skill owns the intent and the desired velocity. Paths stay on bevy-navigation. Transform integration stays on bevy-character-movement. Line-of-sight sensors stay on bevy-spatial-queries.

## ECS shape

- **Components:** a mode flag can be an enum `Component` (see bevy-state-machines for the pattern). Goal position can be your own component. No agent, radius, or layer type was opened.
- **Resources:** a shared patrol table can be a `Resource` you define. No navigation resource was opened.
- **Systems:** read the mode and write a desired velocity or waypoint on `Update` or `Fixed`. Use `.chain()` so policy runs before movement. Do not call an agent callback that writes `Transform`.
- **Schedule:** `Fixed` / `FixedMain` when the result feeds the movement step.

## Policy map

| Need | Owner |
| --- | --- |
| Chase vs patrol vs wait | Enum `Component` plus a system that writes `Goal` |
| Retarget throttle | `Timer` resource ticked on `FixedUpdate` |
| Crowd and avoidance | bevy-navigation |
| Bake and obstacles | bevy-navigation |
| Line of sight | bevy-spatial-queries |

Policy writes `DesiredVelocity`. It does not move `Transform` and it does not query a navmesh.

```toml
[dependencies]
bevy = "0.20"
```

```rust
#[derive(Clone, Copy, PartialEq, Eq, Component)]
enum Brain {
    Wait,
    Patrol,
    Chase,
}

#[derive(Component)]
struct WaypointIndex(usize);

#[derive(Component)]
struct Goal(Vec3);

#[derive(Component)]
struct DesiredVelocity(Vec3);

#[derive(Component)]
struct Player;

#[derive(Resource)]
struct PatrolRoute {
    points: Vec<Vec3>,
}

#[derive(Resource)]
struct RetargetClock(Timer);

The rest: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/HEAD/skills/bevy-ai-navigation/SKILL.md
