> For the complete documentation index, see [llms.txt](https://finite-machine-studio.gitbook.io/advanced-zombie-ai-pro/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-pro/advanced-zombie-ai-pro.md).

# Advanced Zombie AI Pro

<figure><img src="/files/67RrRemweWytNLlC1l0m" alt=""><figcaption></figcaption></figure>

## Welcome

Advanced Zombie AI Pro is a zombie behaviour AI asset for Unity. It is built around a central `ZombieAI` component, a `ZombieProfile` ScriptableObject, Unity `NavMeshAgent` movement, configurable Animator parameters, target-region vision, damage events, noise investigation, hunger, eating, stun, crawling mode, animation death, ragdoll death, waypoint wandering, and zombie spawning.

The asset is intended for survival, horror, horde, stealth, arena, and third-person action games where designers need tunable zombie behaviour without rewriting the AI controller for every enemy type.

## Features

* **Profile-driven zombie behaviour**\
  Create different zombie types using `ZombieProfile` assets instead of rewriting code. A single zombie prefab can become a slow walker, fast runner, crawler, alert zombie, corpse eater or stealth-sensitive zombie just by changing profile settings.
* **Full finite state machine**\
  Includes Idle, Wander, Alert, Chase, Inspect, Search, Stun, Hit, Attack, Eat, and Dead states.
* **Five-region target detection system**\
  The player/target can define five body regions: Top, Bottom, Center, Left, and Right. These can be placed on areas like head, lower body, chest, left side, and right side. The zombie casts vision checks toward these regions instead of using only one center point.
* **Stealth-friendly partial detection**\
  You can control how many visible body regions are needed before the zombie reacts. For example, if the zombie sees only one region, it can enter Inspect mode and investigate. If it sees three or more regions for long enough, it can enter Chase mode. This makes the asset useful for stealth gameplay, cover systems, and partial visibility situations.
* **Configurable vision and obstruction checks**\
  Vision uses field of view, view distance, target layers, obstruction layers, trigger interaction, and body-region raycasts. Walls, doors, props, and level geometry can block sight using the obstruction mask.
* **Inspect and Search behaviour**\
  Zombies do not have to instantly chase the player. If they partially see the player, hear a noise, lose the target, or react to non-aggro damage, they can inspect a suspicious position and then search nearby locations.
* **Random wandering and waypoint wandering**\
  Zombies can wander randomly on the NavMesh or follow an ordered waypoint path. Waypoints can override idle/wait settings and fire events when reached.
* **Alert before chase**\
  Zombies can play an Alert state before chasing. This is useful for scream, roar, head-turn, or “player spotted” animations.
* **Nearby zombie alert system**\
  A zombie can alert nearby zombies when it spots the player. You can control the alert radius and the chance that nearby zombies respond, making horde-style behaviour possible.
* **Chase memory and target loss**\
  Zombies can continue chasing for a short time after losing line of sight. After the lose timer expires, they search from their current chase position instead of instantly giving up.
* **Attack system with stand and chase attack types**\
  Zombies support stand attacks and chase attacks. The attack type is driven through Animator parameters, and attack events can fire immediately or from animation events for accurate hit timing.
* **UnityEvent-based attack integration**\
  `OnStandAttack` and `OnChaseAttack` let you connect zombie attacks to your own player health or gameplay systems without forcing a built-in player health solution.
* **Health and damage system**\
  `ZombieHealth` supports damage, current health, maximum health, health changed events, damaged events, and death events. Damage can include attacker, hit point, and hit direction.
* **Hit reaction system**\
  Zombies can react to damage with hit animations. You can control the minimum damage required, whether damage causes aggro and which states can be interrupted by hit reactions.
* **Damage aggro or local investigation**\
  If Aggro On Damage is enabled, damage can make the zombie chase or remember the attacker. If disabled, the zombie can search around its current hit position instead, useful for stealth weapons, traps, or distraction-based gameplay.
* **Stun system**\
  Zombies can be stunned for a random profile-based duration or a custom scripted duration. Stun stops behaviour temporarily, then resumes based on target visibility, remembered positions, or passive behaviour.
* **Hunger and eating system**\
  Zombies can lose hunger over time, search for food, eat it, and restore hunger.
* **Dead zombie food support**\
  Zombies can treat dead zombies as food sources.
* **Standing and crawling modes**\
  Zombies can start standing or crawling. Standing zombies can also fall into crawling mode after their standing health is depleted, creating a second combat phase.
* **Animation death and ragdoll death**\
  Death can be handled through animation or ragdoll physics.&#x20;
* **Head look IK support**\
  Humanoid zombies can look toward the target during Alert, Chase, and Attack states.
* **Noise reaction system**\
  Gameplay events can notify zombies about noise. Zombies within the noise radius can inspect the sound position, useful for gunshots, alarms, doors, explosions, or thrown distractions.
* **Profile-driven zombie audio system**

  Configure zombie sounds using ZombieAudioProfile assets without writing code. Supports separate loop and one-shot AudioSources, state-based sounds for all zombie behaviours, random clip selection, timed vocalizations, configurable 3D audio settings, and pause-safe playback for natural, immersive zombie audio.
* **Zombie spawner**\
  Zombies can be spawned over time or when other zombies die. The spawner supports multiple prefab choices and configurable spawn counts.
* **Custom editor tools**\
  Includes setup tools, custom inspectors, runtime status displays, waypoint path creation and validation warnings.
* **Debug visualization**\
  Debug Mode shows current state, current mode, visible regions, detection status, hunger, FOV arcs, and vision rays. This makes it much easier to tune stealth, chase, search, and attack behaviour.

## Requirements And Compatibility

The core runtime needs Unity navigation and physics features:

* Unity's AI Navigation Package for movement.
* Colliders for target detection.
* Optional ragdoll child rigidbodies and colliders for ragdoll death.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://finite-machine-studio.gitbook.io/advanced-zombie-ai-pro/advanced-zombie-ai-pro.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
