Search Unity

HoloLens Input Module raycast way off from cursor on World Space Canvas

Discussion in 'VR' started by quitebuttery, Jun 6, 2016.

  1. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    Does anyone have the problem when using world space canvases that the input module seems to be using the wrong position for the raycast? My cursor is over a button, but it does not highlight. It's only when I move the cursor way off the button that the button highlights--as if the raycast for the input module is way off.

    Also the cursor doesn't collide with the canvas at all. Even when the button is highlighted.

    But I checked the code and it seems fine to me--maybe it's something to do with the construction of the canvas?
     
    Last edited: Jun 6, 2016
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Hello,

    Would you mind attaching a repro project so we can see the issue you are referring to? The only thing I can see is that when you use the default Canvas X,Y,Z coordinates can cause some issues. The default canvas value is 90 meters out on the Z axis which is extremely far, usually you want the canvas at 0,0 and the UI component not farther than 5 meters past the camera.

    Could you please file a bug for this issue.
    Please Include a Repro Project, Detailed Description and Repro Steps.

    Thank you,
    Wesley
     
  3. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    Sure thing @Unity_Wesley -- Case 803484, run the scene called "Basic" -- It's probably something dumb that I'm doing but I'm kind of at a loss. This seemed to have just worked on b16. I'm testing with my Rift in the Editor, BTW--but that used to work fine.
     
  4. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Looking at the repro project attached to the bug appears to working fine for me. This build only supports the HoloLens, you can use other Hardware , but it is not supported on this branch.

    Running on the HoloLens the Cursor appears to line up with the Button UI in the basic correctly.
     
  5. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    @Unity_Wesley -- I guess it comes down to the fact that I was testing it in editor using the Rift vs. running on the device. This used to work on 16, but it seems it doesn't work on this one. Will Rift and HoloLens be supported in the HTP again? It's SUPER useful for debugging stuff in the editor by looking at it in the Rift.

    It tracks and moves around fine, but it's this UI trace on the rift that doesn't seem to work.

    I have 2 HoloLenses, but testing in the editor with the Rift is key to quick iteration on stuff.
     
  6. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    @quitebuttery At this time there only be HoloLens support in the Technical Preview. There are plans to move this into our main branch so there will be support for the other platforms.
     
  7. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    @Unity_Wesley Ok--so how does one test in the editor until then? I guess I need to unplug my Rift? Because in the editor window it's always displaying in the Rift. I suppose if I unplug it and then use the keyboard/mouse I can test in Editor?
     
  8. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    You could test in the editor, another way is to have the emulator installed on your machine. This way you could quickly deploy and test.
     
  9. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    @Unity_Wesley cool--but the big deal is, if you have an oculus plugged in while HTP is running, the Editor is going to get the inaccurate traces through the UI etc. because it automatically uses that. I guess I'll keep it unplugged when testing in the editor, but perhaps in future versions of HTP you could just disable the Oculus plugin-in until it's supported?
     
  10. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Hello,

    Thank you for letting me know, could you file a bug on that specific issue please.

    i.e.
    Editor will always use oculus when plugged in

    Thank you,
    Wesley
     
  11. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
  12. nonlin

    nonlin

    Joined:
    Dec 12, 2013
    Posts:
    46
    Was a solution ever found for this issue?
     
  13. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    220
    Looks like it was fixed back in June. In case you're on an older build and can't upgrade for whatever reason, there is a workaround:
    - (temporarily) enable VR support in Standalone, Oculus will appear there by default
    - select the Oculus entry there and remove it (click the minus sign)
     
  14. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    So can you now preview HoloLens in the Rift again? I didn't know that! Is there something special you can do to enable it or does it just work?
     
  15. nonlin

    nonlin

    Joined:
    Dec 12, 2013
    Posts:
    46
    I'm not sure it is fixed, or I've discovered a new bug potentially?
    I'm in the latest version of holotool kit using their new modules and it is still happening.
     
  16. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    220
    @quite_buttery Sorry, I thought you meant the bug as reported for case 804619, which was just that the Rift would get used when it shouldn't. Definitely wasn't intended to ever be that way, sorry for the confusion.
     
  17. orangelv

    orangelv

    Joined:
    Feb 11, 2015
    Posts:
    1
    I have exactly the same problem in 5.6p4. Tried everything, but HololensInputModules raycast seems to be offset. It seems that it sees UI components centered around their lower left corner - that is offset by half width and half height. Regular raycast works correctly and my custom 3d cursor collides with UI correctly.
     
  18. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Are you using simulation in the editor? If so make sure that the Aspect is set to remote resolution in the game panel, otherwise you will see this offset.