Scaling Player to in-game character

To enable different players to control the same in-game character, no matter of the differences in their height/arm lengths, the Motion Controller Transforms must be scaled (up or down) to match the size of the player to the in-game character.

The goal of this scaling process is to match the transforms of the motion controllers to the in-game character. The figure below show the positions of the three tracked points before scaling relative to the size of the in-game character and after applying the scaling.


  

One way of achieving this is to offer an in-game player scaling setup stage.

The Demo VR game does this by asking the player to go to T-Pose, and press a certain button combination on the motion controller at game start. This assumes that the reference pose for your in-game character is a T-Pose. Once this is done, the distance between the two controllers is measured, and a scaling factor to match this distance to the in-game character is calculated. The blueprint nodes below show how this is performed.

The below blueprint nodes do the following:

  1. Get the position of the in-game character left and right hand in Actor space.
  2. Get the position of the left and right motion controllers in Actor space.
  3. Calculate and set a new scale for the VROrigin node as follow:
    • Calculate the difference between character left and right hand positions
    • Calculate the difference between player (Motion Controller) left and right hand positions
    • Find the ratio between the two hand to hand distances
    • Set the scale of the VROrigin node to the new scale factor

Following these steps, we ensure that any size player can drive the same in-game character even with the different body proportions.