Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question VR + Desktop Event System? Not working...

Discussion in 'AR/VR (XR) Discussion' started by JudahMantell, Sep 15, 2020.

  1. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    473
    Hey! So I'm working on a VR project that also needs a second user to interact with UI elements on the 2D monitor.
    Everything works fine in VR (I followed the tutorial series below), but then when I add a Screen Space/Overlay canvas for desktop UI elements, and a new default event system, my desktop isn't taking input from my mouse.

    I know this has to do with the fact that I'm using two event systems (the desktop works if I disable the VR pointer), but I need both to be running/working at the same time. Is this possible? Is there a better way to do VR Pointer input so it will work?

    Thanks!

    VR Pointer Tutorial:
     
  2. jorgeolothar

    jorgeolothar

    Joined:
    Mar 27, 2016
    Posts:
    26
    I have a similar issue. I need a non VR menu on screen to work while a user is in VR (for demo booths).

    It is kind of sporadic when the mouse works or not. Sometimes it works when I'm in a mixed scene and the user hasn't put on their headset, other times when you reset the VR controllers. If it stops working, it will stop working in non-Vr scenes as well, like the main menu
     
  3. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    473
    I posted this a long time ago, so I since then figured out a solution:
    Using Unity's XR Toolkit and it's event systems basically solves this problem. You can use it for both VR pointers and Desktop UI events. The one catch is that you must be using Unity's XR Interaction Toolkit.

    Hope that's helpful!
     
    matthewcook likes this.
  4. jorgeolothar

    jorgeolothar

    Joined:
    Mar 27, 2016
    Posts:
    26
    I'll give it a try!
    Do you know if version 1.0.preview is enough? I see a version 2.0preview, which seems to include all sorts of other functionality that I might not want to deal with at the moment
     
  5. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    473
    I'm sorry, I haven't used it in a while and I'm not really sure what's best to use as of right now. I'm sure there are plenty of resources online, or maybe even some more qualified people to help you with this :)
     
  6. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    I have reworded my search about 8 times and this is always the top item google gives me. Unity's XR Interaction Tool Kit 2.0.0 is not an auto fix for this issue. I have an asymmetrical game with the user being able to press buttons on the desktop but as soon as the VR controller is turned on the desktop buttons stop working and this post seems to be the only one I can locate that mentions the issue. Any one have any ideas?

    EDIT:
    Right after posting this I had a thought and I disabled my event system to see if the controller was creating a system and a conflict. Sure enough when I have the system enabled and start the scene no second system is generated but, when the controller is turned on the existing system stops working. However if the event system is disabled Unity is generating an event system and the VR controller and the desktop GUI work. I don't know where the script is that's generating the event system but turning off the one I had in the scene seems to fix the issue when using interaction tool kit 2.0.0

    Note: The event system generated by a GUI that I had to turn off used an "InputSystemUIInputModule" script on it while the generated input system uses "XRUIInputModule" noting this I was able to change my event system to use the proper module and now when I open the scene it doesn't generate a second conflicting system and I can place the event system in the scene without relying on unity to generate one.

    PROBLEM SOLVED!
     
    Last edited: Aug 24, 2022
    wayne04191 and JudahMantell like this.
  7. masontprather

    masontprather

    Joined:
    Apr 13, 2022
    Posts:
    3
    Having the same issue. If anyone knows a solution to this, it would be greatly appreciated.
     
  8. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    It is likely the duplication of an event system or an alternate event system in your scene either two or more in your hierarchy before you press play or one in your hierarchy and at least one more Bing generated on play. See the note in my previous post and MidnightCoffee Inc's comment about the Unity XR interaction tool kit.