> For the complete documentation index, see [llms.txt](https://finite-machine-studio.gitbook.io/advanced-zombie-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://finite-machine-studio.gitbook.io/advanced-zombie-ai/advanced-zombie-ai.md).

# Advanced Zombie AI

<figure><img src="/files/IDrSuZieW7R6QCkfG260" alt=""><figcaption></figcaption></figure>

### Welcome

Advanced Zombie AI is a component-driven enemy system for Unity. It provides a complete foundation for creating zombies that wander, perceive targets, chase, attack, react to damage, crawl, vault, and die.

### Features

* **Three wandering modes:** Choose between random wandering, ordered waypoint patrols, or following a moving target. This makes it easy to create zombies for survival horror, wave-based gameplay, or fast-paced COD-style modes.
* **Hearing system:** Zombies can react to sounds made by the player, such as footsteps and gunshots.
* **Target memory:** When a zombie loses sight of its target, it continues searching for a configurable amount of time before giving up and returning to its normal behaviour.
* **Standing and crawling phases:** Zombies can collapse into a crawling state after their standing health is depleted. Crawlers have their own health, movement speeds, animations, and wandering, chasing, and attacking behaviour.
* **Vision-based detection:** Configure field of view, detection distance, sight origin, and line-of-sight checks to control how zombies detect targets around walls and level geometry.
* **Head and body LookAt IK:** Zombies can turn their head and upper body towards their target while chasing or attacking.
* **Waypoint actions:** Each waypoint can make a zombie continue immediately, wait for a while, scream, or play a custom animation before moving on.
* **Flexible target support:** Use the included ZombieTarget component to make players, NPCs, objectives, or other GameObjects valid zombie targets.
* **Responsive chasing:** Configure chase speed, target memory, and movement offsets to prevent groups of zombies from crowding into the exact same position.
* **Context-sensitive attacks:** Use separate attack animations for stationary targets, moving targets, and crawling zombies.
* **Basic stealth system:** Players can move quietly to reduce the chance of being detected and sneak past nearby zombies.
* **Combat system integration:** Connect attacks, damage, and death events to your existing combat system through Inspector UnityEvents or C# events.
* **Headshot support:** Assign the zombie’s head hierarchy and apply a separate damage value when it is hit.
* **Automatic ragdoll death:** Zombies can switch to ragdoll physics when killed for more natural-looking deaths.
* **Flexible spawning system:** Continuously spawn random zombie prefabs over time or spawn a new zombie whenever an existing one dies.
* **NavMesh vaulting:** Zombies can detect Off-Mesh Links and play a dedicated vault animation while crossing obstacles, ledges, or gaps.
* **Guided setup window:** Set up new zombie characters through a simple three-step editor workflow. Existing components are preserved, missing requirements are added automatically, and all changes support Undo.

### Requirements

The zombie runtime requires:

* An `Animator`.
* A `NavMeshAgent`.
* A valid baked NavMesh beneath the zombie.
* At least one `ZombieTarget` in the scene.

The Zombie AI Setup window also adds a `SphereCollider` when it is missing. Keep a suitable collider on each zombie so weapons, triggers, and other physics-based gameplay can identify it.

#### Unity packages

The included project uses:

| Package                   | Purpose                                              |
| ------------------------- | ---------------------------------------------------- |
| AI Navigation             | Authoring and baking NavMesh surfaces and links.     |
| Input System              | Used by the optional demo player and weapon scripts. |
| Universal Render Pipeline | Used by the included demo visuals and materials.     |

The core AI runtime does not read player input. If you use only your own player controller and visual assets, the Input System dependency applies only to the included demo assembly.
