> For the complete documentation index, see [llms.txt](https://october-studio.gitbook.io/monster-survivors-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://october-studio.gitbook.io/monster-survivors-documentation/input/input-system.md).

# Input System

The game uses [Input System](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.12/manual/index.html) and allows seamlessly switching between different devices during any stage of gameplay.

{% hint style="info" %}
Input system was added in the 1.0.2 version of the game. It features slight changes to the scene hierarchy. We recomend creating a back up of your project before updating to this version of the template.
{% endhint %}

| Platform             | Input Gameplay                 | Input UI                 |
| -------------------- | ------------------------------ | ------------------------ |
| PC                   | UI Joystick, Gamepad, Keyboard | Mouse, Gamepad, Keyboard |
| WebGL                | UI Joystick, Gamepad, Keyboard | Mouse, Gamepad, Keyboard |
| Mobile (IOS/Android) | UI Joystick, Gamepad           | Touch, Gamepad           |

### Input Asset

Input Asset located at:![](/files/yHYLUbv0VrSqFbxAUL91)\
It contains two action maps: UI and Gameplay

#### UI Action Map

This action map contains default UI actions like click and navigate, as well as two custom actions:&#x20;

* Settings - this action is responsible for opening settings window in main menu and for opening pause window during gameplay.&#x20;

  <figure><img src="/files/eFbmWYXJhE6K3uANGrts" alt=""><figcaption><p>Settings action bindings</p></figcaption></figure>
* Back - this action map is responsible for closing main menu windows and pause window in during gameplay.

  <figure><img src="/files/XkHa7oDQf2MlvoSB5bt1" alt=""><figcaption><p>Back action bindings</p></figcaption></figure>

#### Gameplay Action Map

This action map contains only one action - Movement. It is responsible for the movement of the character during gameplay.

<figure><img src="/files/aT8rWIapnIJnJramVUah" alt=""><figcaption><p>Movement action bindings</p></figcaption></figure>

You can add additional bindings to the actions above to accommodate for more specific devices.

### Input Manager

Input Manager manages switching between different input types, provides access to the [Input Asset](/monster-survivors-documentation/input/input-system.md#input-asset) and controlls the visibility of UI Joystick and Button Highlights.

```csharp
public class InputManager : MonoBehaviour
{
///...
    // This value shows the currently active input type (UIJoystick, Keyboard, Gamepad)
    public InputType ActiveInput { get => save.ActiveInput; private set => save.ActiveInput = value; }
    
    // This value is used for calculating movement of the player
    public Vector2 MovementValue { get; private set; }
    
    // This event fires every time the input type changes
    // First parameter is the previous input type
    // Second parameter is the new input type
    public event UnityAction<InputType, InputType> onInputChanged;
//...
}

// Use GameController.InputManager to get Input Manager from anywhere from the project
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://october-studio.gitbook.io/monster-survivors-documentation/input/input-system.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
