Search Unity

Question New Input System and UI Button select

Discussion in 'Input System' started by Borjabor, Feb 16, 2023.

  1. Borjabor

    Borjabor

    Joined:
    Dec 9, 2021
    Posts:
    1
    Hello everyone,

    Firstly, let me apologize if this was solved somewhere else before, but I couldn't find this specific case, but perhaps I just didn't know how to properly search the forums. In any case, here's my issue:

    I'm trying to allow the player to navigate and select UI buttons in a pause menu with mouse, keyboard, and gamepad. While the navigation is working, whenever the player selects and option - like "Resume Game" - Unity, and the build version, freezes completely. It doesn't crash, only freezes. However, the same button works fine if the player simply clicks with a mouse. So, at the moment the menu works if the player just closes it by pressing start/escape or by clicking the option with the mouse.
    I have linked the Pause Menu script I'm using, but I'm not sure what else could be helpful. My setup is a simple UI, with two buttons that call the ResumeGame and Exit methods from the script using the OnClick UnityEvent. I have switched the EventSystems to use the new input system and have hooked it up to the one I made, that is working for my player.
    Anyway, let me know if any more information is needed, or if it is only a matter of setup.
     

    Attached Files: