Search Unity

What's the proper way to move the OVRCameraRig position and rotation? (Oculus Integration)

Discussion in 'VR' started by Skyl3r, May 28, 2019.

  1. Skyl3r

    Skyl3r

    Joined:
    May 4, 2014
    Posts:
    3
    Hello,

    I'm using the oculus integration tool from the asset store to build an Oculus Quest application. I've put the OVRCameraRig object into a scene and it works correctly when I run it on the Quest. However, I want to press a combination of buttons to set the position and rotation of the headset. I can't find what the proper way to do this is.

    I've tried putting a script on the OVRCameraRig object which sets the position and rotation via:
    Code (CSharp):
    1. this.transform.position = new Vector3(x,y,z);
    2. this.transform.eulerAngles = new Vector3(x,y,z);
    The result is it doesn't seem to move to the correct position, and it teleports back as soon as I release the buttons.
    I also have tried putting the OVRCameraRig into an empty GameObject and manipulating the empty GameObject instead. That also does not seem to work as expected.

    I'm interpreting what's happening as the cameras having their own offset within the OVRCameraRig object (probably due to room scale?). How can I force the cameras to a specific transform?


    Thanks,

    Skyl3r