Pause Menu Buttons with Input System UI

I want to preface this with that I haven’t used Unity since the Input Manager and “GetKeyDown” was used in the scripting. This whole new Input System feels very over-complicated to me but that is definitely because I don’t fully grasp the concept. That being said I have made a 2D side-scrolling game where the player can walk down a hallway and interact with objects along the way. So far the player controls are working fine for me.

The problem comes from implementing my pause menu. Within the script I have:

void Start()
{
controls.PlayerControls.Pause.performed += _ => OnPause();
}

public void OnPause()
{
    if (!gamePaused) {
        pauseMenuUI.SetActive (true);
        Time.timeScale = 0f;
        gamePaused = true;
    } else {
            pauseMenuUI.SetActive (false);
            Time.timeScale = 1f;
        gamePaused = false;
    }
}

When the game is playing I am able to hit “P” for pause and my pause menu shows on screen.

The button that is supposed to be highlighted is (Resume) but that’s the only evidence that my Event System attached to the “PauseMenu” panel works. Here is what the PauseMenu panel Inspector looks like:

It does not respond to my mouse hovering over the buttons it does not respond if I press “P” again to exit the pause screen, I can’t use the arrow keys to select the button underneath it. Nothing happens. I have tried reading the documentation on the Input System and the UI Input Module Script but that just confuses me even more.I am sure there is something that I am missing somewhere but if anyone can help me out with this I would be so appreciative. :slight_smile: If any additional screenshots are needed let me know.

1 Like

Wrong forum - this forum is for Unity’s new UI Toolkit (VisualElement/UXML/USS implementation). For UGUI, you should use this subforum: Unity Engine - Unity Discussions

Thank you! I quickly realized that this was probably the wrong spot but I was holding out to see if someone had an answer here. I posted it in the Input System forum but I will also try where you suggested, thank you.