Skip to main content
Up and Coming
July 14, 2015

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

    2 replies

    Inspiring
    July 14, 2015
    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.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    khos85Author
    Up and Coming
    July 14, 2015
    "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!