Skip to main content
Up and Coming
October 2, 2014

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!
    This topic has been closed for replies.

    6 replies

    Inspiring
    October 2, 2014
    This should do the trick!
    if (Input.GetKey(KeyCode.Return) ) {
    print("Reset Orientation: " + OVRDevice.ResetOrientation() );
    }
    Up and Coming
    October 2, 2014
    just press R? Check out the keyboard commands in the unity oculus integration guide
    http://www.quitenice.co
    Up and Coming
    October 6, 2014
    Pressing R didn't work, but MikeF's code did! I just put it in Void Update under OVRDevice.cs
    Up and Coming
    October 7, 2014
    To get the 'R' trick to work I think you need to have OVRMainMenu.cs in use in your project.
    Cubicle Ninjas Custom VR App Development Guided Meditation VR for Rift, Gear, and Go
    Up and Coming
    October 7, 2014
    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();
    Up and Coming
    October 7, 2014
    Thanks everyone! Very helpful :)