Multiple UI menus, but arrow keys only work on the first one

Hello! As the title stated, I have multiple UI menus trying to use the keyboard arrows and enter. However they only work on the first menu. When I do and activate the second menu no buttons are highlighted nor do they work in any way with the arrow keys.

I suspected it was because the “First Selected” in the EventSystem was set to the first button on the first menu and so tried to create a script to change it to the first button of the second menu, and while it does change in the inspector, nothing works in the menu still…

I think this might be the magic sauce you’re looking for:

EventSystem.current.currentSelectedGameObject

I imagine you would keep a list of GameObjects for each of your menu pages, and when you go switch between them, first you would read the above and save it to the proper one for this menu, then set the new menu active, and dig up the correct GameObject for that menu to be active and set the above.

I haven’t used the first-selected one you mention, but a little script that only fires once could recognize “hey, I haven’t been shown yet, I’m the first,” and select it automatically, if the stored GameObject is null.