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

Placing HMD on head stops Mouse input working (EventSystem), but keyboard is still okay.

Discussion in 'Input System' started by Tset_Tsyung, Jul 7, 2022.

  1. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Hi all,

    I have an interesting issue that I think is caused by my not fully understanding the InputSystem yet.

    VR Input works, and so does the Keyboard Input (which is set up on the relevant script itself, and not in an asset like the VR and Mouse Input - it only listens to the space bar after all).

    The mouse input also works (using the same InputActionAsset as the VR, just a different ActionSet).

    However, I cannot use the VR and Mouse input together. AS SOON as I put on the HMD, all UI buttons will stop responding to mouse clicks. As soon as I take it off again, I can click on buttons once more and have the desired response.

    I'm using Unity 2021.2.7f1, InputSystem 1.3.0 and XR Plugin 4.2.1

    Any thoughts would be greatly appreciated.

    Kindest regards,


    Mike
     
  2. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Solved:

    If you have the Canvas set as "Screen Space - Overlay" then it will default to the XR camera for event (I had it XR rig set as Main Camera).

    But, if you set thecanvas to "Screen Space - Camera", and assign the Desktop/Monitor Camera as it's Render Camera, then it's using this as the raycast point for events.

    [Facepalm] In hindset it's a bit of a no-brainer, lol.

    UPDATE:
    This was either, not the solution, or not the entire solution. On the InputSystemUIInputModule, there is a dropdown entitled "Pointer behaviour" (see pic below). Setting this to "All Pointers As Is" fixed the solution for me. When I know why this works, I'll update further below.

    Screenshot 2022-07-14 131700.png

    Regards,

    Mike
     
    Last edited: Jul 14, 2022
    HiziProjects likes this.
  3. HiziProjects

    HiziProjects

    Joined:
    Nov 29, 2013
    Posts:
    4
    You're a savior.. I was losing my mind trying to find out why UnityXR would just block all mouse inputs when HMD is being worn and I was finding nothing but bug threads and unrelated issues.. And Unity's documentation is a joke as always

    May your life be filled with delicious food