> 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/shared-components/weapon-collision-manager.md).

# Weapon Collision Manager

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

The **Weapon Collision Manager (AC\_CollisionManager)** is a component that dynamically handles collision tracing, hit detection, and damage processing for weapons. Tracing is enabled or disabled at runtime through the [**Weapon Trace Notify**](/animation-notifies/damaging-and-combos/weapon-trace-notify.md), ensuring collision checks occur only during specific animation frames.

It is added to the **parent Weapon Item** Actor class by default **(B\_Item\_Weapon).**

### **How It Works**

1. **Initialization**:
   * On `BeginPlay`, the component:
     * Reads the **Trace Sockets** for the start and end positions of the weapon trace.
     * Configures **Trace Radius** and **Trace Types**.
     * Sets up the tracing logic but keeps it **paused by default**.
2. **Animation Notify State (ANS\_WeaponTrace)**:
   * **ANS\_WeaponTrace** is used within weapon animations (e.g., attack swings) to toggle tracing:
     * **Enable**: Starts weapon tracing by unpausing the Event Tick.
     * **Disable**: Pauses weapon tracing to stop unnecessary checks.
3. **Collision Tracing (On Event Tick)**:
   * When tracing is enabled:
     * Performs a **Multi-Sphere Trace** using the socket positions and substepping to combat framerate dependency.
     * If a valid target is detected, the **OnActorTraced** event fires, passing hit data for processing.
4. **Damage and Effects**:
   * The `OnActorTraced` logic handles:
     * **Damage Calculation**: Uses weapon stats and modifiers (e.g., scaling, random variance).
     * **Damage Application**: Applies point damage to the hit target.
     * **Visual Feedback**: Spawns effects like blood splatters or sparks at the impact point.
     * **Audio Feedback**: Plays sound effects for weapon hits.
5. **Debugging**:
   * The **Trace Debug Mode** visualizes traces in real-time, helping developers fine-tune trace positions and radii.

### Example Usage

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