Skip to main content
New Participant
June 8, 2015

RayCasting From VR Camera In Unity

I am currently trying to figure out how to raycast from the VR Camera (meaning that it cast from where the player is looking with the headset). Has anyone done this in Unity yet? Or can some help tell me how to access the head tracking information to raycast from. Any help or tips is much appreciated!
    This topic has been closed for replies.

    3 replies

    Inspiring
    June 8, 2015
    You can try casting the ray from CenterEyeAnchor.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    June 8, 2015
    EDIT: Center Eye Anchor is not a camera in the OVR Camera rig, chose LeftEyeAnchor or RIghtEyeAnchor instead.

    Its not that hard. There is nothing special about ray casting from the oculus, you dont need any head tracking info, in fact you can test by ray cast from the Unity standard FPS Controler/FirstPersonCharacter and when your ready for VR, just switch to the Center Eye Anchor from in the OVR Camera rig..



    Run this tutorial for a DK2 reticle. When your done you will have a useful script and learn enough to raycast from the oculus..



    https://www.youtube.com/watch?v=LLKYbwN ... 1zCJqFJwqw
    RiverExplorer
    Honored Contributor
    July 10, 2022

    That youtube video is NOT available.

    RiverExplorer.US]@gmail.com https://RiverExplorer.games