Forum Discussion

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

How to reset camera perspective of rift using unity?

Hi there,

I want to reset the camera perspective with a certain key. I am currently using the following code but several problems occured:

public class ResettingView : MonoBehaviour {

private OVRDevice ovrdevice ;

void Update()
{
if (Input.GetKeyDown ("Keycode.V))
{
OVRDevice.ResetOrientation (0);
}
}
}


It does not recognise OVRDevice nor ResetOrientation, so I guess it has been renamed in the updated extension (the update that was released for using the rift with the free version of unity).
What library do I have to include to be able to use OVRDevice?Within the current OVR folder I could not find a function or class that fitted ResetOrientation. All I could find was OVRManager.capiHmd.RecenterPose().

Can you help me on either using the function above or explain to me what function I have to use instead?

Thanks a lot!

2 Replies

Replies have been turned off for this discussion
  • The code to reset/recenter the orientation is like this:

    if (Input.GetKeyDown (KeyCode.Alpha7))
    OVRManager.display.RecenterPose();