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


---

# 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/player-specific-components/interaction-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.
