> 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/menu-navigation.md).

# Menu Navigation

Starting with the version 1.0.2 of the template we use default ui navigation that comes with [Input System](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/UISupport.html).&#x20;

### Navigation Inside Pages

Every scene you want to have UI navigation in should have game object with the Input System UI Input Module Component attached.

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

For every page you must ensure the following:

1. It assigns a one of it's buttons as selected when opened using  `EventSystem.current.SetSelectedGameObject(button.gameObject);`&#x20;
2. Subscribe to the GameController.InputManager.onInputChanged event. If the new InputType is not UIJoystick, than assigns a one of it's buttons as selected again.
3. All of it's buttons can navigate only to each other. Use Navigation field of a Button Component.
4. Every Button Component that can be selected also has to have Highlightable Button UI Component.&#x20;

   <figure><img src="/files/sdLCTp81wGaM6KE1Im8M" alt=""><figcaption><p>Highlighted button</p></figcaption></figure>

### Button Highlights

If the active input type is Gamepad or Keyboard, the selected button that has Highlightable Button UI Component attached will be highlighted with two small animated arrows. \
The prefab for the arrows "Button Selection Arrow" is located here:<img src="/files/np3wEFlHuXnIfCmFv6f6" alt="" data-size="line">\
You can change it with any other image you want, animated or not.

The arrows are spawned inside Highlights Parent Canvas, that is a child of the Input Manager Game Object from the Main Menu scene. This canvas is drawn on top of every other canvases to prevent hierarchy from interfering with the arrows

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


---

# 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/menu-navigation.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.
