Search Unity

GraphicsRayCaster and VR controller

Discussion in 'VR' started by chilton, Mar 10, 2019.

  1. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    564
    Hi,

    I'm trying to leverage the Unity GUI system by adding a GraphicsRayCaster to my VR controllers.

    As I understand it...
    GraphicsRayCaster - necessary to track hits on uGUI.

    PointerEventData - necessary to trigger the typical mouse events.

    The thing is, I want the GRC to work on a controller, not the headset. And the PED looks like it requires knowing where the GRC is hitting, in order to work.

    So, do I do a Raycast from the GRC, then get the results, then convert that to screen space, then assemble the PED and do a SECOND Raycast with the GRC + PED combo, in order to make this work?

    Otherwise, I don't know where the GRC is hitting, in order to populate the PED with the 2D screen location.

    Any and all suggestions welcome and encouraged.

    -Chilton