Skip to main content
June 27, 2016

Rotating the player's view?

Hey everyone,

I'm experimenting with VR, and I wanted to see what I could do by offsetting the player's worldview. 

As a simple test, I created a plane and gave it a 10 degree x-rotation. I attempted to do the same to the OVRPlayerController and several of its child cameras/transforms/anchors. Unfortunately, on play, everything instantly "snaps back" to the proper headset orientation.

In other words, my question is: What's the best way to offset the input headset rotation by a constant (in this case, 10 in the x)?

Thank you for your time.
    This topic has been closed for replies.

    3 replies

    Inspiring
    June 27, 2016
    Once the app is running, the local pose of the Camera becomes read-only. The best way to move it around is to make a parent GameObject and move that as needed. OVRCameraRig and OVRPlayerController both do it this way. See the "TrackingSpace" GameObject.
    June 28, 2016
    Thank you for the reply! Please, forgive me, but I'm still quite new to this!

    I tried creating an empty GameObject, setting its rotation to match that of the plane, and making the OVRPlayerController its child. It didn't seem like this had done anything, so I encased the plane in a box with walls too high to see the tops of to make sure I wasn't seeing things wrong.

    Perhaps my approach has been wrong? I operated on the assumption that if I gave the player the same xz-rotation as the surface they were standing on, the surface would appear to be flat rather than tilted. Was this idea incorrect?

    Thanks again!
    Inspiring
    June 28, 2016
    OVRPlayerController is based on Unity's character controller and it is mainly intended for walking around in a free-moving first-person setting. If you are trying to control the location of the camera, OVRCameraRig is probably the right utility to use. If you make that a child of another GameObject, or just set the pose of the OVRCameraRig itself, it should work the way you want.