# 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>


---

# Agent Instructions: 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:

```
GET https://soulslike-framework.isik.vip/components-managers/shared-components/weapon-collision-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
