Enemy AI Starter Kit — Start Here

Three enemies, three worlds, one brain. This kit teaches enemy detection and pursuit — the sense → decide → act loop — through three one-click demos:

What you need

What's in the kit

Path What it is
Scripts/Enemy3D/TargetSensor.cs Reusable detector: range + FOV cone + line of sight
Scripts/Enemy3D/EnemyAI3D.cs Patrol→Chase→Attack state machine on a NavMeshAgent
Scripts/TopDown2D/GridPathfinder2D.cs Full A* on an auto-baked grid
Scripts/TopDown2D/EnemyAI2D.cs The same FSM, driven by A* paths
Scripts/Platformer2D/PlatformerEnemy2D.cs Feelers, vision cone, alert, edge-aware chase
Scripts/Common/ Demo players, follow camera, damage flash
Scripts/Editor/EnemyKitSetup.cs One-click demo arenas + NavMesh auto-bake
Tutorial/ These lessons

Fastest possible start (2 minutes)

  1. Open an empty scene.
  2. Tools → Enemy AI Starter Kit → Create 3D NavMesh Enemy Demo (the NavMesh bakes automatically).
  3. Press Play. WASD to move. Get seen, get chased, duck behind a wall until it gives up.
  4. Repeat with the 2D Top-Down and 2D Platformer demos — each in a fresh empty scene.

While playing, select the enemy in the Hierarchy: every sensor, feeler, patrol route, and A* path is drawn as gizmos in the Scene view. That live view is the best teaching aid in the kit.

Lesson path

  1. 01 - Enemy AI Concepts — the FSM and the sense→decide→act loop
  2. 02 - Setup and NavMesh — AI Navigation package, baking, agent settings
  3. 03 - The 3D Enemy — two detectors, chase, lose-sight, return to patrol
  4. 04 - A-Star for 2D Top-Down — how A* works, and reading the kit's implementation
  5. 05 - Platformer Enemies Beyond Back-and-Forth — feelers, cones, alerts, and when to graduate to node graphs
  6. 06 - Tuning and Extending — gizmos, tuning for difficulty, hearing, investigate states, behavior trees

Reference library

Official:

Community:

Next: 01 - Enemy AI Concepts