Forum Discussion

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

Camera height on OVRPlayerController?

Hi,

I'm using Unity v5.1.1f1, Oculus Utilities v0.1.0, OVRPlugin v0.5.0 and I cannot figure out how to set the height of the camera(s) in my OVRPlayerController ? If I move them up, they just go back down to almost ground position at runtime.

My other older games weith older SDKs seem to work fine, it's just this new SDK, I cannot figure out how to set the player height.

Any help would be most welcome. :)

2 Replies

Replies have been turned off for this discussion
  • The value should come from the user's profile set in the Config Util. It's recommended you use the value from there.

    If you need to adjust this manually (for example, for debugging purposes) you can deselcted "Use Profile Data" in the OVRPlayerController inspector setting. Then add the following code to the bottom of Update() in OVRPlayerController.cs (around line 213):

    Vector3 heightAdjust = new Vector3 (0f, 1f * Time.deltaTime, 0f);
    if (Input.GetKey (KeyCode.I)) {
    CameraRig.transform.localPosition += heightAdjust;
    } else if (Input.GetKey (KeyCode.K)) {
    CameraRig.transform.localPosition -= heightAdjust;
    }


    Again, you shouldn't do that in a final game, only for testing.
  • "cybereality" wrote:
    The value should come from the user's profile set in the Config Util. It's recommended you use the value from there.

    If you need to adjust this manually (for example, for debugging purposes) you can deselcted "Use Profile Data" in the OVRPlayerController inspector setting. Then add the following code to the bottom of Update() in OVRPlayerController.cs (around line 213):

    Vector3 heightAdjust = new Vector3 (0f, 1f * Time.deltaTime, 0f);
    if (Input.GetKey (KeyCode.I)) {
    CameraRig.transform.localPosition += heightAdjust;
    } else if (Input.GetKey (KeyCode.K)) {
    CameraRig.transform.localPosition -= heightAdjust;
    }


    Again, you shouldn't do that in a final game, only for testing.


    Cool, thanks cybereality! Works perfect!