> For the complete documentation index, see [llms.txt](https://soulslike-framework.isik.vip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soulslike-framework.isik.vip/components-managers/ai-only-components/ai-combat-manager.md).

# AI Combat Manager

<div align="left"><figure><img src="/files/Pxb9F1D6r6SRb7Q5t5rd" alt=""><figcaption></figcaption></figure></div>

The **AI Combat Manager** (**AC\_AI\_CombatManager)** component is responsible for handling AI combat interactions, including damage processing, hit reactions, poise/stance breaks, unarmed combat, and death handling. It functions *similarly* to the [**Combat Manager** used for the player](/components-managers/player-specific-components/combat-manager.md) but is specifically designed for AI, ensuring that AI enemies can react to incoming attacks, process damage correctly, and execute appropriate combat behaviors.

It is added to the **Soulslike Enemy (B\_Soulslike\_Enemy)** class by default.

### **How It Works**

* **Event Bindings**
  * **Registers AI combat events**, such as `OnTakeDamage` and `OnStatUpdated`, to ensure AI responds dynamically to combat situations.
* **Ability Selection**
  * The `TryGetAbility` method (called from **BTS\_TryGetAbility**) is used to retrieve a possible attack Ability while the AI is in Combat state.
* **Damage Handling**
  * **Listens for incoming damage events** and adjusts HP accordingly. If HP falls to zero, it triggers the death logic.
* **Poise System**
  * **Listens for poise stat changes & manages poise mechanics,** triggering a stagger/stun when poise is broken (if Poise falls to zero)
* **Stance Breaks & Hit Reactions**
  * Upon taking damage, the `HandleHitReaction` method checks if Stance is broken, if so, determines the correct hit reaction animation and applies knockback forces based on damage impact.
* **Weapon & Projectile Damage Processing:**&#x20;
  * Handles incoming melee and projectile attacks, applying damage effects accordingly.
* **Unarmed Combat**
  * Uses socket-based tracing for unarmed combat.
* **Notify Related Properties**
  * Manages defensive properties such as [**Hyper Armor**](/animation-notifies/defensive/hyper-armor-notify.md) **&** [**Invincibility**](/animation-notifies/defensive/invincibility-frame-notify.md) which can be toggled through notifies.
* **World Healthbar Updates**
  * Updates the world UI, displaying AI health changes in real-time, Souls style.
* **Death Handling**
  * Initiates the AI death sequence, plays the ragdoll/directional death animation and stops AI controller logic.

### Example Usage

<figure><img src="/files/7lRFLNW1fMtHU5RYw7sq" alt=""><figcaption></figcaption></figure>
