Forum Discussion

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

How to set default Player Height?

Using the OVR character to controller, where do you set the default player height?

I can change it with 5,6, but can't seem to find where it sets the default of 1.85.

6 Replies

Replies have been turned off for this discussion
  • Anonymous's avatar
    Anonymous
    I found that its set in playerpref, but no idea how or where to set that outside of editing the playerpref file directly. Thoughts?
  • You should be able to edit the 'height' value in the character controller component (on the OVRPlayerController prefab).
  • janla's avatar
    janla
    Honored Guest
    If you set the height value, the "Player Height" in VRVariables menu (hit spacebar) still displays 1,85m
    I wanted to find out why, and it's because the OVRMainMenu script doesn't check the capsule height, but calculates it from the default height of 2.0. Would be nice to fix that at some point...
  • Sorry, my bad.

    You actually want to edit the "Neck Position" Y-value in OVRCameraController in the editor.

    This will update the value in the OSD.
  • janla's avatar
    janla
    Honored Guest
    Hi,

    just if someone is interested, I've tweaked the OVRCameraControler Script, so it sets the Neck and Eye Position automaticly depending on the the Character Controlers height ( = your actual body height )

    I calculate the values according to this relations: http://mech.utah.edu/ergo/pages/Educational/safety_modules/ctd-anthropometry/index_files/image002.gif

    Just add the following code to the Start() function:

    // manually enter the unexposed skinwidth parameter from the character controller here
    float skinwidth = 0.08f;

    // calculate distances
    float height = transform.parent.GetComponent<CharacterController>().height ;
    NeckPosition.y = 0.87f*height-height/2f- skinwidth;
    EyeCenterPosition.y = 0.936f*height - NeckPosition.y -height/2f - skinwidth;


    EDIT: this is porbably redudant when you use the IPD.
  • binofly's avatar
    binofly
    Honored Guest
    var p = CameraRig.transform.localPosition;
    p.y = OVRManager.profile.eyeHeight - 0.5f * Controller.height

    change eyeHeight to 0.2 f
    it will work