Search Unity

InputSystemUIInputModule does not work with PlayerInput Buttons do not recieve input

Discussion in 'Input System' started by deividkamui, Feb 12, 2020.

  1. deividkamui

    deividkamui

    Joined:
    Jul 10, 2013
    Posts:
    6
    Hi,

    I've created a scene with my Inventory UI which has a EventSystem, a InputSystemUIInputModule and a PlayerInput components from the new Input system, the components are configured as shown on the screenshot.

    Annotation 2020-02-06 052550.png

    The issue is that every time I enter play mode the buttons on the UI do not recieved any input.

    No Input Example:
    noInput.png

    Input Allowed Example:

    takeInput.png

    As soon as I remove the PlayerInput component the buttons become interactible again, but I lose the action of closing the UI with the tab key or the pause button on a controll.

    I don't know if this is a bug or it is just a miss configuration on my side.

    Any help would be appreciated this is making me mad.
     
  2. deividkamui

    deividkamui

    Joined:
    Jul 10, 2013
    Posts:
    6
    This was the only workaround I found: Do not combine the InputSystemUIInputModule with a PlayerInput component instead use the old StandarInputModule component so you can have custom inputs and buttons responding to clicks

    Annotation 2020-02-12 231038.png

    Not optimal but until an official response this is what I'm going to do.
     
  3. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Hmm, which version of the input system is this happening with? There was a bug where having a PlayerInput would break the UI but that was fixed a couple versions ago.

    Could you pop open the input debugger (Window >> Analysis >> Input Debugger) and compare the stuff in the "Actions" and the "Users" branch in the w/ PlayerInput case vs the w/o PlayerInput case?

    Overall, what I'm seeing of the setup in the screenshots, I'd expect it to work just fine. Feel free to file a ticket with the Unity bug reporter and we'll have a closer look at what's happening here.
     
  4. deividkamui

    deividkamui

    Joined:
    Jul 10, 2013
    Posts:
    6
    Hi,

    I'm using Unity 2019.3.1f1 and the Input package version is preview.4-1.0.0

    Here is the comparison with and without PlayerInput, I notice that for some reason the UI/Navigate, UI/Point and others from UI are empty in the case with PlayerInput.

    Annotation 2020-02-13 205535.png Without.png

    However here is a screenshot from my inputs assets, so the inputs are defined.

    Controls.png
     
  5. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Would like to take a closer look. Could you file a ticket with the Unity bug reporter?
     
  6. KarolStolaDD

    KarolStolaDD

    Joined:
    Sep 10, 2019
    Posts:
    7
    I have the same issue, I've noticed that it suffices to disable PlayerInput during runtime to make it work and pinned down the issue to two functions inside OnDisable:

    Code (CSharp):
    1. --InputUser.listenForUnpairedDeviceActivity;
    2. m_InputUser.UnpairDevicesAndRemoveUser();
    Calling them makes the mouse work again.
     
  7. KarolStolaDD

    KarolStolaDD

    Joined:
    Sep 10, 2019
    Posts:
    7
    Oh nevermind, it turned out that my binding wasn't assigned to control scheme.
     
  8. deividkamui

    deividkamui

    Joined:
    Jul 10, 2013
    Posts:
    6
    The bug was patched in the last package update. But now there is a little bug in the PlayerInput component if you have assigned to a prefab.

    The bug:

    If you edit and save the prefab, no matter what you have change when you return to your scene for some reason the Actions property of the PlayerInput is set to null so if you enter play mode your character won’t move and if you are using Unity events all of them appear to be remove.

    The Fix:

    So in order to fix it you just need to reassign inside the prefab the actions property, it’s a little annoying but once you do that all the Unity events will be reassigned. Hope they will patch this little bug in the next update.
     
    arsuhinars likes this.
  9. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
  10. diliupg

    diliupg

    Joined:
    Jan 23, 2018
    Posts:
    45
    You say it was fixed but the FIX IS BROKEN in Unity 2020.3 LTS all versions up to 18f1! What a sad state. :-(
     
  11. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    209
    Same problem here. Sadly I switched to 2020 recently. Seems I have to move back. 2 days wasted.
     
  12. PuzzleBuilder

    PuzzleBuilder

    Joined:
    Jan 1, 2017
    Posts:
    14
    I think I'm experiencing the same issue. Looking at my input debug, certain UI actions loose their binding when under a "User", but not under "Actions". However, I'm still experiencing this issue in Input System 1.3.0. Did anyone fix this by updating Unity as well? I have Unity 2019.4. If anyone has fixed this issue, please let me know what version of Unity and Input System they have installed.
     
  13. PuzzleBuilder

    PuzzleBuilder

    Joined:
    Jan 1, 2017
    Posts:
    14
    Just looked into this possibility, and it was the case for me too. I hadn't assigned a control scheme to some of my action bindings, so they weren't working or showing up in the input debug.
     
  14. MikeGDev

    MikeGDev

    Joined:
    Dec 19, 2017
    Posts:
    53
    I have a similar issue in Input System version 1.3.0 and Unity 2021.2.9. The UI Input wont work as long as the PlayerInput is enabled. When disabling the PlayerInput the UI works again.

    EDIT: So my issue was that I couldn't use a mouse as a touch input with the On-Screen Stick. As it turns out it was because the control scheme didn't have mouse included as a requirement. Including it makes PlayerInput work with UI input as intended.
     
    Last edited: Feb 10, 2022
    wmensh0704 likes this.
  15. Otakingggg

    Otakingggg

    Joined:
    Nov 24, 2020
    Posts:
    1
    I'm still having the same problem, if I enable the "Player Input" component my UI doesn't receive any input anymore. Is there still a bug with Unity, or does anyone know some type of fix for this?
     
  16. lordyluke

    lordyluke

    Joined:
    Oct 28, 2017
    Posts:
    9
    In my case, the issue was that I created my custom input actions asset from scratch and created a keyboard control scheme there, instead of creating keyboard&mouse control scheme. I then selected and copied the actions from the DefaultInputActionAsset and pasted the UI part into my own one, but it didn't get mapped to any control scheme, because DefaultInputActionAsset is using keyboard&mouse scheme and mine didn't have it.

    What was happening was that before spawning player, I was able to work with UI using mouse, but after spawning player with PlayerInput component I was not.

    What I suggest to try is to locate the original DefaultInputActionAsset, create a copy of that, assign it to your playerInput and start building on top of it, instead of starting from scratch, and then check whether the issue persists.
     
  17. Pandazole

    Pandazole

    Joined:
    Sep 23, 2019
    Posts:
    28
    I had similar issue, the HUD UI is working at start of the game, after opening then closing the main menu (Which enable UI map, then disable it) makes my HUD is not accepting any pointer interfaces like "IPointerDownHandler" and "IPointerClickHandler".

    I solved my issue by making the event system and Input System UI Input Module in the same object of Player Input:

    upload_2023-9-3_21-24-48.png

    Hope it help someone! Since it was pain for me :D

    Unity version: 2022.3.7f1
    Input system version: 1.6.3