Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Button UI Not Working with The new Input system

Discussion in 'Input System' started by suiksuiky, Dec 22, 2019.

  1. Nianyi_Wang

    Nianyi_Wang

    Joined:
    Sep 9, 2021
    Posts:
    5
    Yes. Sorry for the late reply. The solution is to upgrade the IS package to the latest version. There seems to be a bug in the earlier version.
     
  2. Galaxyben

    Galaxyben

    Joined:
    Jul 19, 2017
    Posts:
    5
    This worked for me as well.
     
  3. chrisjfarr

    chrisjfarr

    Joined:
    Feb 17, 2018
    Posts:
    4
    The fact that this thread is two pages long with a dozen or so suggestions to fix this problem...makes me want to vomit when thinking about using this new Input System. I tried a few of these in the PlayGround.scene with just a simple Button added. Nothing changed, same behaviour. Cursor disappears when I click the Button, and the action is not invoked. No thanks Unity. Please take this garbage back to the drawing board.
     
  4. brianduper

    brianduper

    Joined:
    Nov 12, 2020
    Posts:
    3
    this was my solve. so strange because i have a duplicate scene and the same setup with canvas and inputsystem worked fine. so weird this hidden setting was the trick.
     
  5. DiePflanze

    DiePflanze

    Joined:
    Jul 31, 2019
    Posts:
    4
    Hey people, just wanted to add my solution after struggling for two days :/

    I use UI Toolkit and the new Input System. I also use the First Person Starter Asset. I copied the UI Actions from the DefaultInputActions into the StaterAssets ActionMap. In my case, with the help of this thread, i could get the Buttons to Highlight when i hovered them with the mouse, but no ClickEvent was fired when clicking, even though the buttons showed their clicked state (turning slightly grey when clicked).
    This post showed me a working solution: https://forum.unity.com/threads/reg...orking-after-document-is-reactivated.1255713/
    The problem was that i was enabling/disabling the UIDocument-gameobject for hiding or showing the UI, which seems to break the callback-registration i did in Start() or OnEnable().

    Instead, i did what was suggested in said thread and voilá, it worked. I do not enable/disable the UIDocument anymore, instead, i set its style.display property to DisplayStyle.None for beeing hidden or DisplayStyle.Flex for beeing show. Works like a charm and i questioned my life choices only four times trying to figure this out.
     
  6. Tradecenter77

    Tradecenter77

    Joined:
    Jan 15, 2021
    Posts:
    5
    OMG, after two days of headaches I found my solution. And I do feel kind of dumb about it.
    The Input System was on a fixed update, and my menus pause the game by setting Delta Time to zero. So, all my controls stopped working when I opened menus, but worked when I just launched the game with the menu open (because delta time wasn't set to zero which happens for me when I open a menu).

    Setting the update mode in the project settings to Dynamic update fixed my issue.

    Hope this helps someone.
     
  7. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,377
    I spent the better part of the day trying to figure out why my UI was totally unresponsive.

    I had the EventSystem. I had the Input System UI Input Module. The ISUIM's Actions Asset pointed to my Input Action Asset. All of the little fields like Point, Left Click, Move, etc., all appeared on the Component.

    But @celinedrules post above made me go check the contents of my Input Action Asset. Even though it was directly copied from the Starter Assets pack, I found that NONE of the UI/Whatever events were registered for KeyboardMouse or any other input scheme. Just blank. No checkmarks. Effing useless.

    Seriously, debugging crap like this is a drain of energy and makes me hate the Assets-wagging-the-Dog nature of the Input System all the more.
     
  8. tommyroberts526

    tommyroberts526

    Joined:
    Jan 8, 2022
    Posts:
    1
    This is probably from forever ago but oh my god tysm. This fixed my problem! :D
     
  9. Aida_Mercury

    Aida_Mercury

    Joined:
    Aug 24, 2020
    Posts:
    2
    This fixed my problem -> EventSystem ->Input system UI input module (script) -> deselect on background click -> false.