Forum Discussion

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

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.

3 Replies

Replies have been turned off for this discussion
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    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.
  • 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!
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    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.