Forum Discussion

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

Recentering the Oculus in Game

Does anyone know what kind of script I would need to 'reset' the oculus camera in game? I have a tech demo that requires a consistent eyepoint, but since people will be at different heights and handing over the Rift in the middle of a demo, it would be great if I could just map some kind of 'reset' key so when a 5'3" person gives the Rift to a 6'3" person, all I need to do is hit spacebar and the eyepoint will go back to where it was.

Thank you!

6 Replies

Replies have been turned off for this discussion
  • This should do the trick!
    if (Input.GetKey(KeyCode.Return) ) {
    print("Reset Orientation: " + OVRDevice.ResetOrientation() );
    }
  • just press R? Check out the keyboard commands in the unity oculus integration guide
  • Pressing R didn't work, but MikeF's code did! I just put it in Void Update under OVRDevice.cs
  • To get the 'R' trick to work I think you need to have OVRMainMenu.cs in use in your project.
  • for the DK2 there is the reset orientation function like the DK1 used but also a recenter position function. I use them like this with good results. No OvrMainMenu.cs script needed for this either.

    OVRDevice.HMD.RecenterPose();
    OVRDevice.ResetOrientation();