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

Strange quirks with Unity UI / Hololens

Discussion in 'VR' started by AntonieB, Sep 5, 2017.

  1. AntonieB

    AntonieB

    Joined:
    Apr 9, 2013
    Posts:
    17
    I made a UI in unity but i'm getting some strange results. I got the feeling the 'hit' detection is a bit strange because multiple buttons get 'selected' on strange times.

    I added a short movie showing a bit of the effect but it is strange and sometimes when I'm not even close to buttons they highlight as if i'm hoovering over them.

    See:


    It must have something to do with the raycasting / how the input events get handled with Hololens toolkit but I can't get my head around it.

    Anybody any hints / tips to get this working beter? I also have problems with button presses not registering the first time / sometimes have to click multiple times before the button is working.

    Thanks already for watching / helping me out!
     
    sbagchi likes this.
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Which version of Unity are you running this project on?
     
  3. AntonieB

    AntonieB

    Joined:
    Apr 9, 2013
    Posts:
    17
    I was running 2017.1.0f3 and just upgraded to 2017.1.1f1 (and upgraded the holotoolkit to the latest release)
     
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    I've seen this behavior before and never saw the reason until you called it out. I just filed a new bug for it.

    I'm guessing you're recording your screen in Play mode in Editor in the above video? If so, workaround for now for you is move your mouse cursor to the center of your game view when in play mode. The raycast is looking for your mouse position even though it's drawing the gaze cursor where you'd expect it to, straight in front of you.
     
  5. AntonieB

    AntonieB

    Joined:
    Apr 9, 2013
    Posts:
    17
    I tried your suggestion but can't see the 'cursor' having any impact on the selection of buttons. (I have another movie indeed screen recorded with my phone of the 'Play mode'.



    You don't exactly see it in the video but I can't get any influence in what is selected on the screen with my mouse. Is there a way to somehow debug / show the raycasts or anything that is used with the hololens / gui system?
     
  6. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
  7. Lostlogic

    Lostlogic

    Joined:
    Sep 6, 2009
    Posts:
    693
    Are you using the example code by microsoft with the OnSelect() message being sent to objects? If so, you may be sending OnSelect() to an entire hierarchy of objects that have the function; hence, them firing randomly. I had this problem until I was more careful about nesting objects with OnSelect() in them. May or may not help but it was an issue I ran into.
     
  8. Dmidcap

    Dmidcap

    Joined:
    Sep 20, 2017
    Posts:
    2
    I'm having a similar problem myself, did you ever find a fix to this? My problem is that the spot my cursor is standing over when the UI elements are highlighted is not in line with the the actual UI Elements.

     
  9. Lostlogic

    Lostlogic

    Joined:
    Sep 6, 2009
    Posts:
    693
    I have the same issue with UI elements. In using the MS example UI, the two buttons are both highlighted at the same time.
     
  10. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    If you're still struggling with the UI feel free to file a new bug and we can take a look at your project specifically. We can then make a better determination if it's something Unity is doing poorly or HoloLens. If you do submit a new issue, put "[Hololens]" in the title to make it land on our team a bit quicker.
     
  11. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    148
    Part of it is because you need to update the event systems horizontal, vertical, submit and cancel buttons
     
  12. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    148
    But your particular issue may have been fixed in recent MRTK updates
     
  13. AntonieB

    AntonieB

    Joined:
    Apr 9, 2013
    Posts:
    17
    Thanks for all the replies / for me it seems like my issues (around quirky ui navigation) are fixed in latest MRTK updates. I'm now using Unity 2017.1.2 and the latest MRTK from github.