Search Unity

Player Height in VR

Discussion in 'AR/VR (XR) Discussion' started by HeyHuman, Sep 1, 2017.

  1. HeyHuman

    HeyHuman

    Joined:
    Sep 1, 2017
    Posts:
    1
    Hey All,

    I have a human character in VR to represent the player, so when the player looks down s/he could see the torso and legs. My issue is that if I have players with different heights this will result different view of the torso an legs.

    I have tried to lock the Y axis movement in headset, but this didn't help. Any idea on how to approach this issue it will be highly appreciable.

    Many thanks in advance.
     
  2. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    My workaround for this issue is to detect when the headset has been removed then replaced on the user's head. Once the user is present again, call InputTracking.Recenter().

    This will give you a stable point of reference. In all honesty, I think you're still going to have to try to respect the fact that tall people will expect to have the same point of view both in and out of the headset. Trying to force the Y position can be disorienting unless the user is sitting down in VR (like you're doing a car sim or something).
     
  3. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Once you have stable tracking you could make the avatar rigged model scale to change it's size depending on player height, and keep its feet flat on floor. If your rig has root node at 0,0,0 then you dont need to TranslateY. Scale Y the needed amount. Do that only once at scene start.

    Then after that:

    If you read lower HMD height and controllers dont move Z:
    IK bend knees and hip to match height while keeping spine upright

    If you read lower HMD height and controllers do move Z:
    IK bend waist and neck keeping cam root upright.

    That's a mini project in it's own right, are there any suitable assets on store maybe?
     
    sdutter likes this.
  4. SuperScience

    SuperScience

    Joined:
    Feb 10, 2016
    Posts:
    17
    If you're using SteamVR, just scale the camera rig.

    1. Get the Y pos of the headset
    2. Figure out the ratio of their standing height to the desired height (just Y pos of the headset)
    3. Scale the camera rig by that ratio
    4. Scale the controller models up by the inverse of that ratio

    Boom: your player is now whatever height you want them to be.
     
    Ony, zivmahluf, ROBYER1 and 1 other person like this.
  5. vincent-deco

    vincent-deco

    Joined:
    Jul 21, 2021
    Posts:
    3
    If you are using an oculus and have remove guardian (dev mode) then activate it, configure it, recenter (with oculus button long press) then you can deactivate it and it should be all good