Is it possiable to Scale Character to HMD Height?

I think this is a VR in general issue, if not please direct me to the appropriate forum.

I am using Vive and SteamVR in room mode.

I have added a character to a scene and linked it with SteamVR and VRIK (FinalIK) which all works fine.

The issue comes about when someone either smaller or larger than me tests my scene.

If smaller than me, then the character gets bent over, not standing straight up.

So my question is, how do other developers deal with different player height HMD and characters?

One thought would be to scale the character, but its a matter of when, and how do you guarantee the player is standing upright?

Thanks

Looks like nobody is answering, maybe it’s the question. So let me retry it a different way without the IK.

If a HMD says it’s 1.6 meters above the floor and I have a character that is 1 meter tall (gnome) how do I get the HMD to think it’s 1.6m is the same as the characters 1m height?

Do I scale everything in the world play scene to make the 1m tall character to be 1.6m?
Or is there a simpler way that Other people have found?

Please note there are multiple character selections each with different heights prior to the actual play scenes.

Thoughts?

Did you ever solve this? I am working with the Vive and considering scaling the player character to match the height of the camera. The problem I have is that the experience is persistent. I’ll have to hit a button or find some other way to scale the character model to match the players height.

Good morning, Unfortunately, I have not completely solved the issue. I have been on vacation the last few weeks and now feel renewed, so I will be working on this aspect again and hopefully later this week will be able to provide a detailed answer for you.

I’m trying to find a good solution for this problem as well, and using final ik on the character. I’d be happy to throw ideas around. I’m look for a way to scale the player based on hmd height, like in the start of hover junkers

1 Like

So there’s 2 separate issues here.

  1. How to scale the Player:Model or vice versa
  2. When to get the players real world height

In terms of scaling, you can either scale the entire VRRig up or down to make the player your desired height, or scale the model to match the current player. Generally I tend to favor the former, as I figure a hero/character should be the same height in the game world, regardless of the players realworld height. So in that case, I usually import my models to a reference height of 6ft (1.83m), and then counter scaled from there.

So if a shorter person is playing, say realWorldHeight = 1.5m, you would counter scale like:
VRrig.scale = Vector3.one * (1.83f/realWorldHeight); //Give this player a 22% height boost to feel 6ft tall

The other way you could do it, is the inverse, just scale the model up and down to match the player.
vrik.scale = Vector3.one * (realWorldHeight/1.83f); //Scale the model to 82% to match the shorter player.

In terms of when to get the height, there’s a few options.

  1. You can just have a button in settings, “Calibrate Height”
  2. You can display some GUI, before the level loads, telling player to stand up, or spread their arms, then measure.
  3. You can continuously measure & scale for the first 10-30 seconds of the level, and just hold onto the max height that you see in that first period of time.
1 Like

Sorry for the delay, but shawnblais is correct, he has outlined what I ended up coming up with.

The only thing different I did, and I’m not totally convinced its necessary was that I created a holder object for both the rig and the character, just so I could scale one without having it affect the other.

I have a script that alters the model’s height based on the height of the player. To do this, I get the height of the headset from VRTK and use that along with the height at roughly the same point on the model.

At first, I tried using the overall height of the model and comparing that to the height from the headset but realized those aren’t the same thing. Now, I attach a transform to the model at about the position the headset should be in and use that.

      // I added an invisible transform to the model at about the same 
      // place on the model as where the headset would go.
      modelHeight = target.transform.localPosition.y;

       // Calculate max player height. This is actually the height of the player
       // at the headset in the real world.
       playerHeight =  headsetTransform.position.y - this.transform.position.y;
       maxPlayerHeight = Mathf.Max(playerHeight, maxPlayerHeight);
      
       // Scale the model not the VRIK rig
       model.localScale = Vector3.one * (maxPlayerHeight / modelHeight);

This seems to work pretty well. The model gets scaled to about the player’s height.

The next issue I would like to solve is scaling the arms based on the actual length of the players arms. Right now, the arms of my model are a bit short for me and, when I try to pick up something, the hand position over shoots the object I’m trying to pick up. Haven’t really gotten this going since I need similar points on the arm in the real world to similar points on the model. Anyone have any suggestions?

1 Like

Our results with that experimentation, is that IK based arms will never really work well, our brain is just way too picky about elbow location, if the arm is too short, by even 1", it feels crap, if the arm is too long, and the elbow never straightens, it also feels crappy.

We ended up going with a tube-arm approach, where we disable the models actual arms, and re-create them using a tub renderer that comes out of the models shoulders, and hooks into the hands. This works great, and the arms never feel ‘wrong’ like they do with VRIK. This approach only really works if you have a toony style though, and can just swap in some tubes for the arms.

See the following tutorial about scaling the height and arms in VR:

The length of the Makehuman made arms are short by quite a bit even after the height is corrected so I scaled a couple of the arm bones separately. This still uses the arm IK and is much more realistic than streatching the arm meshes.

You can also download a free unity package that includes the avatar I used here:
http://www.solidearthvr.com/shared/free_avatar_asset

I plan to release a tutorial on how to do this in a more automated way.