Track Oculus Camera Direction and use as input

I’m using Unity 4.1.1 and Oculus Integration with prefab OVR PlayerController and OVRCameraRig with Oculus DK2. Is it possible to use the left/right/up/down information that comes from the Oculus (where the user’s head is pointed) as an input to control position and rotation of objects in a scene? I’d like to have certain objects rotate back and forth or move up and down to mirror the motion of the user’s head when wearing the oculus.

Thanks!!

When using Oculus, it comes with a rig that has one GameObject for each eye. If you want, you can reference the transform of one of those for rotational data.

So, just create a GameObject field in your script called OculusEyeRight. Set the right eye to that variable in the inspector. Now, you can use things like OculusEyeRight.transform.forward for the appropriately rotated forward vector.

Not entirely sure this solution will work with the version you are using, but this link might interest you:

https://forums.oculus.com/viewtopic.php?t=16710

@FortisVenaliter @cjr11094 Hello! Sorry to jump onto this thread but really trying to get help with my oculus & unity and support don’t seem to want to help :frowning:

I have installed the oculus plugin, dragged into my scene the OVRcam and localavatar for the controllers. I can see through the headset and can see the controllers but the buttons do not work so I’m unable to ‘walk round’ my scene?!

I’ve also tried the new XR plugin but that doesn’t even let me look through the headset. Not sure what I’m doing wrong :frowning:

Please help!