3

I'm using an Oculus Rift with Unity, and am attempting to allow the user to zero-out the orientation of their device when they push a key. The idea is that the camera is frozen looking in a particular direction, and when the user begins the game, whatever direction they're looking in is bound to that camera orientation. I found this forum post, but it only says to use SetOrientationOffset, but doesn't provide code.

I've tried both of the following, independent and together:

OVRDevice.ResetOrientation ();
cameraController.SetOrientationOffset (Quaternion.identity);

However, neither seems to have an effect. I've even tried passing other quaternions into SetOrientationOffset, but that seemed to have no effect.

Does anyone have a working code example?

Community
  • 1
  • 1
IanPudney
  • 5,941
  • 1
  • 24
  • 39

1 Answers1

0

If different quaternions make no difference then you probably have a game object set in the FollowOrientation variable. If you clear that then passing in different quaternions should have an effect. Alternatively you can rotate the thing you've set in FollowOrientation. Then you need to find the correct orientation to start in. Probably the rotation of the frozen camera is what you need.

Tubeliar
  • 836
  • 7
  • 20