Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Xzapo's avatar
Xzapo
Honored Guest
11 years ago

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!

3 Replies

Replies have been turned off for this discussion
  • 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