Search Unity

[VRTK] Using VRTK_UIPointer with multiple worldspace canvases.

Discussion in 'AR/VR (XR) Discussion' started by mcoutie, Oct 22, 2017.

  1. mcoutie

    mcoutie

    Joined:
    Jun 19, 2017
    Posts:
    1
    I'm running a game where there are a series of computer monitors spread around an office and I've placed a worldspace canvas against the screen of each monitor with a quiz using UI Buttons and other UI elements. My right oculus touch controller is assigned with a UIPointer script and a straight point renderer to make it clear where it's pointing.

    My error is occuring when there are multiple canvasses that line up with the UIPointer; The buttons on the closest canvas seem to be inactive when the raycast continues through to another canvas, and by changing the angle of the pointer the button on the closer canvas is active as long as the pointer does not line up with another canvas.

    I don't really have my head wrapped around how this raycasting works for the UIPointer, but is there possibly some way to force it to stop at the first canvas, or perhaps place another GameObject behind the canvas to act as a blocker?
     
    tlskillman likes this.
  2. lane-s

    lane-s

    Joined:
    Feb 2, 2017
    Posts:
    1
    I've got the same issue. I think it has to do with Graphics Raycaster / VRTK_UI Graphic Raycaster, but I haven't figured out what determines which canvas is actually tested for hits.
     
    tlskillman and ledjfou125 like this.
  3. tlskillman

    tlskillman

    Joined:
    Dec 12, 2015
    Posts:
    16
    This has me stumped too. I would like to just interact with the first canvas it collides with. If you figure it out, please post.