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. Dismiss Notice

Bug Cannot interact with UI on second display with new Input System

Discussion in 'Input System' started by garthreilly, Sep 1, 2022.

  1. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    I've just created a very default scene with a canvas and a button on it. Then I added another camera, and another canvas with a button on it, and set that to target Display 2.

    I can interact with the buttons while in the Editor. I.e. I select Display 1, and I can interact with the button on that display, and then I can select Display 2, and I can interact with the button on that display.

    However, when I build the application and run it, I see both displays with their own button on, but I cannot interact with the button on the 2nd display.

    I've tried this on 2021.3.0f1 and 2021.3.8f1 without success.

    It did work on 2020.3.32f1
     
    szamilMST likes this.
  2. Olivier-Tache

    Olivier-Tache

    Joined:
    Feb 27, 2015
    Posts:
    20
    Hi, we have the same issue here (on 2021.3.13f1), have you found a solution since your post ?
     
  3. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    Hi. Apologies for the slow response. No, I haven't, so I did log it as a bug with Unity. They have since reviewed it and confirmed it as being a bug: IN-17801.

    To date, it hasn't been resolved.
     
  4. magnusfox

    magnusfox

    Joined:
    Nov 7, 2014
    Posts:
    26
    I have the same problem in 2022.2.16. I've unsuccessfully tried to find the bug report you mentioned, do you have a link to it by any chance?
     
  5. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
  6. magnusfox

    magnusfox

    Joined:
    Nov 7, 2014
    Posts:
    26
  7. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    We didn't. We've been forced to stay on Unity 2020.3 because of it. The one workaround is to migrate back to the old input system, but there were a few issues there. Off the top of my head, particularly w.r.t touch input and Unity's UI system. Just an update though, as of recently, this bug has now been logged with Unity's Technical Support from an Enterprise User so, fingers crossed, it should get resolved shortly.
     
  8. magnusfox

    magnusfox

    Joined:
    Nov 7, 2014
    Posts:
    26
    Thanks for the update! I can confirm that it works as expected in the last beta version (2023.1.0b14), hopefully the fix can trickle down to the more stable versions as well soon enough.
     
  9. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    Aaah, thanks for that feedback. That is great to know!
     
    magnusfox likes this.
  10. andorfy

    andorfy

    Joined:
    Oct 12, 2015
    Posts:
    24
    Hi everybody, I run into this issue with a VR project. I tested with the 2023.1.0b16 editor version, and the UI on the second screen only works if the headset (Quest 2 via Link) is not connected to the PC. As soon as I start the build with the hedaset connected, the UI can't register any event. I only need a button and a scroll view but I can't interact any of them.

    Is there any idea or workaround for this?
     
  11. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    925
    I have a similar issue, using VR. OpenXR depends on the new input system, which means it's not possible to switch to the old input manager as workaround.
    Are there other possible workarounds?
     
  12. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    I have received recent feedback from Unity that the bug is still not fixed, but there is a possible workaround that they're going to try test out. I'll post the solution if it does work out and they forward the workaround to me.
     
    Flavelius likes this.
  13. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    Same answer as to andorfy: I have received recent feedback from Unity that the bug is still not fixed, but there is a possible workaround that they're going to try test out. I'll post the solution if it does work out and they forward the workaround to me.
     
  14. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    @andorfy @Flavelius @magnusfox @Olivier-Tache :

    Finally have a workaround, received from Unity. I've done it myself and it works in both Unity 2021.3.26f1 & 2022.3.1f1.

    The workaround requires replacing the Graphic Raycaster component in every Canvas with the CustomGraphicRaycaster.cs script (attached). This script is using the display index information that is now returned in the last version of the New Input Package, so, the project also requires to be in the last version of the New Input System.

    NB! The New Input System MUST be v1.6.1 (or higher in the future I assume).
     

    Attached Files:

    jbertra, magnusfox and Flavelius like this.
  15. magnusfox

    magnusfox

    Joined:
    Nov 7, 2014
    Posts:
    26
    Good news! The problem is not present in the latest LTS (2022.3.2f0).
     
    Last edited: Jun 22, 2023
    Flavelius and garthreilly like this.
  16. garthreilly

    garthreilly

    Joined:
    Dec 13, 2021
    Posts:
    9
    Great! Will upgrade my Unity Editor soon then to this...
     
  17. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    925
    The issue is still present in 2022.3.8f1 (input system package 1.6.3), but the custom raycaster above indeed functions as a workaround for now. Thanks
     
    Last edited: Aug 29, 2023
  18. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    925
    And to update, the custom raycaster only works in editor, but not in build (22.3.8f1), so it's still very much an issue.
    Test setup has 2 displays, same resolution or different resolution doesn't seem to make a difference.