# Input Buffer

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

The **Input Buffer Component (AC\_InputBuffer)** ensures smooth gameplay by queuing inputs when actions are unavailable (e.g., mid-animation). When the player inputs a new action while another is active, the system waits for the current action to finish before executing the queued action.

For e.g, Dodging is an action. Jumping is also an action. If we try to Jump while Dodging, we will only be able to Dodge when the buffer is closed:

{% embed url="<https://youtu.be/s6Yiv6cD-6c>" %}
In the video, the Jump action is being triggered simultaneously with the Dodge action. Since Dodge action is triggered first, Jump action is queued.
{% endembed %}

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

### **How it Works**

1. Player inputs an action (e.g., light attack).
2. If the player is already performing an action, the input is stored in the **AC\_InputBuffer**.
3. Once the current action completes (and the buffer is closed), the queued action is executed.

### Example Usages

#### Queueing an action:

<div align="center"><figure><img src="/files/8mrHdz4t0nA4gw61LMpc" alt=""><figcaption><p>Jump Action is queued.</p></figcaption></figure></div>

<figure><img src="/files/QI0lwVGft6Rue6tfPOK8" alt=""><figcaption><p>When buffer is consumed, action will be performed.</p></figcaption></figure>

The buffer windows are handled through the [ANS\_InputBuffer notify state.](/animation-notifies/miscellaneous/input-buffer-notify.md)


---

# 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/input-buffer.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.
