Skip to main content
Up and Coming
July 20, 2015

Scale OVRPlayerController

Using Oculus utilities and Unity native VR.

I have attached the OVRPlayerController to an empty object.
I scale that object to x50 and the view is exactly right.
The Keyboard controls seem to have scaled up, using WASD keys moves the character as much as expected,
however, the gamepad controls did not scale up and movement is very slow.

I can make the gamepad work OK by increasing acceleration in the OVRPlayerController inspector, but then the keyboard controls are so fast as to be "off the map" pun intended.

Is this a bug, expected behavior or am I doing it completely wrong?
    This topic has been closed for replies.

    7 replies

    Inspiring
    July 20, 2015
    Ideally you should not scale any objects. It's much better to create all assets at the proper 1:1 scale in your 3D modeling application. When you scale objects, you will face issues like getting the height and IPD correct for the user, or dealing with problems with the physics engine, etc.
    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
    Up and Coming
    July 20, 2015
    This is sorta the opposite of what I heard from you in another thread, but that's probably my mistake.

    which is why Im not scaling the camera directly, only the empty object with the child camera.

    IPD, height etc all work just fine..

    I'm going for that god like view..


    scaling down everything in the world results in many more challenges..

    particle scaling to the very small is hard
    physics scaling to the very small is near impossible
    small colliders suffer from frequent miss fires
    most assets in the asset store are 1:1s

    I struggled with all of these in first generation of Car Car Crash.

    The current gen is going much better, faster level development etc.
    can I have the less than perfect option :-)
    Inspiring
    July 21, 2015
    Oh, right. Your case is different. If you need a table-top VR experience then you will have to scale the player.

    It's probably that the gamepad script is just calculating things wrong.

    I can check the script later, but feel free to take a look at how it works.
    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
    Up and Coming
    July 24, 2015
    I havent had time to look into this yet.

    Ill try to dig into the gamepad scripts this weekend, do you have any hints?

    Thanks
    Inspiring
    July 25, 2015
    There's a missing variable in the gamepad movement calculation.

    Line 310 to 320 of OVRPlayerController.cs should look like this:

    if(leftAxisY > 0.0f)
    MoveThrottle += ort * (transform.lossyScale.z * leftAxisY * moveInfluence * Vector3.forward);

    if(leftAxisY < 0.0f)
    MoveThrottle += ort * (transform.lossyScale.z * Mathf.Abs(leftAxisY) * moveInfluence * BackAndSideDampen * Vector3.back);

    if(leftAxisX < 0.0f)
    MoveThrottle += ort * (transform.lossyScale.z * Mathf.Abs(leftAxisX) * moveInfluence * BackAndSideDampen * Vector3.left);

    if(leftAxisX > 0.0f)
    MoveThrottle += ort * (transform.lossyScale.z * leftAxisX * moveInfluence * BackAndSideDampen * Vector3.right);


    Basically you just needed to multiply by "transform.lossyScale.z".
    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
    Up and Coming
    July 27, 2015
    THANK YOU! That fixed it right up..
    Inspiring
    July 27, 2015
    Great!
    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