# Combat Manager

<div align="left"><figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FUV6njiSsTDmMslUtngYR%2FActorComponent_64x.png?alt=media&#x26;token=d276668c-ab1e-42b9-ba65-0091dd69d2c4" alt=""><figcaption></figcaption></figure></div>

The **Combat Manager (AC\_CombatManager)** component is the core combat handler for the player, responsible for managing all aspects of player combat, including unarmed attacks, weapon attacks, guarding, poise system, combo chains, and damage application. It is the counterpart to [**AC\_AI\_CombatManager**](https://soulslike-framework.isik.vip/components-managers/ai-only-components/ai-combat-manager), but tailored for a more interactive, **player-driven combat system.**

It is added to the **Character** class by default **(B\_Soulslike\_Character).**

### **How It Works**

1. **Initialization & Event Bindings**
   * When initialized , it binds to key events such as **OnAnyDamage** and **OnStatUpdated**.
   * It listens for stat changes to respond relatively&#x20;
     * For example, death event when Health <= 0, poise break when Poise <= 0, etc.
2. **Damage Handling**
   * Handles incoming damage from various sources (weapons, projectiles, unarmed).
   * Checks player invincibility and adjusts HP accordingly.
   * If the damage reduces HP to 0, it triggers the **HandleDeath()** function.
3. **Unarmed Combat & Hit Tracing**
   * Supports **tracing-based melee attacks** for unarmed combat using **hand sockets**.
   * Tracks traced actors in **FistTracedActors** and processes hit reactions accordingly.
4. **Guarding & Perfect Guard System**
   * Implements a **guard system** with tracking for active guard state, stamina drain, and **perfect guard mechanics**.
   * **Perfect Guard** window is based on **PerfectGuardDuration** and **FacingDirectionAcceptance**.
   * If a perfect guard is executed, an effect is played (**PerfectGuardEffect**) and the incoming damage is completely ignored.
5. **Combo System**
   * Tracks combo sections through **ComboSection** and executes **Montages** dynamically.
6. **Poise System**
   * Tracks the player's **Poise** stat.
   * If poise is broken, plays a **Poise Break Montage** which is used to punish the player.
7. **Hit Reactions**
   * Upon taking damage, after relative stats have been adjusted, tries to play a directional hit reaction **only if the player's Stance stat <= 0** (stagger resistance)**.**
8. **Death & Respawning Logic**
   * Clears lock-on and clears the guard state.
   * Determines the **direction of death** and plays appropriate **ragdoll/death montage**.
   * Drops currency at the death location.
   * Initiates **respawning logic**.

### Example Usage

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FWdoswjhvpqsP6OOO1sEO%2Fimage.png?alt=media&#x26;token=bd811e10-99e4-4fa5-8c14-dc9f033d058a" alt=""><figcaption></figcaption></figure>
