Forum Discussion

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

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?

7 Replies

Replies have been turned off for this discussion
  • 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.
  • 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 :-)
  • 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.
  • 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
  • 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".