> 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FXzKLXa6pKLmKehObNXwm%2Fimage.png?alt=media&amp;token=15ebf4b9-63ce-4ecb-add3-8c117b5f031c" 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2Fpoxe1DnhpmYCpdC6dMGZ%2Fimage.png?alt=media&amp;token=6b522c4c-ab77-4044-a7ca-ca637d19058c" 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2FiXlBRiq3YaU7Pw3kcPbP%2Fimage.png?alt=media&amp;token=669377fa-4c5d-45ad-b4fc-da822ca51288" 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="https://1095504291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiNhXrPwcj8TJ32pNkD2R%2Fuploads%2Ff71GisEKj5KQsDXk9dFK%2Fimage.png?alt=media&amp;token=9b31919c-7d98-4227-a048-ca45ae5c2b63" alt=""><figcaption></figcaption></figure>
