Forum Discussion
FisherDachs
12 years agoHonored Guest
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!
Thank you!
6 Replies
Replies have been turned off for this discussion
- MikeFTrusteeThis should do the trick!
if (Input.GetKey(KeyCode.Return) ) {
print("Reset Orientation: " + OVRDevice.ResetOrientation() );
} - bcoyleAdventurerjust press R? Check out the keyboard commands in the unity oculus integration guide
- FisherDachsHonored GuestPressing R didn't work, but MikeF's code did! I just put it in Void Update under OVRDevice.cs
- CubicleNinjasProtegeTo get the 'R' trick to work I think you need to have OVRMainMenu.cs in use in your project.
- moltonExplorerfor 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(); - FisherDachsHonored GuestThanks everyone! Very helpful :)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years agoAnonymous