> 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/player-specific-components/interaction-manager.md).

# Interaction Manager

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

The **Interaction Manager (AC\_InteractionManager)** handles interactions between the player and nearby interactables. It also manages target locking and target switching for combat.

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

### **How It Works**

1. **Detecting Interactables**:
   * Continuously (on a reasonable interval) traces nearby **Interactable** objects.&#x20;
   * Maintains a list of detected objects and shows the interaction widget for the closest object.
2. **Target Locking**:
   * Upon request, tries to locks onto the nearest valid **Enemy** target and updates the camera and player orientation accordingly.
3. **Target Switching**:
   * Allows switching between nearby targets based on input (e.g., cycling through enemies during combat).
   * Ensures smooth transitions with minimal disruption to gameplay.

### Example Usage

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

<figure><img src="/files/Y2zbWacQdDFOM3X7OkKs" alt=""><figcaption><p>Tracing for Interactables</p></figcaption></figure>

<figure><img src="/files/MPZxMhYqPmEjU77SykDL" alt=""><figcaption><p>Target Locking related traces</p></figcaption></figure>
