Skip to main content
New Participant
March 27, 2020

Scaling OVRCameraRig

Hello All!
I have been looking through the forum and I have found some of my answers, but no one has posted the actual solution.
I would like to scale the OVRCameraRig. I have a full size room, like a living room, and everything looks fine. However, I want to shrink this room down to something small ( or scale up the player ) so the room would look like a doll house.
I know I can scale down the entire environment, but this causes a lot of shaders to freak out so I want to avoid that.
In other VR packages, you would just create a Empty GameObject and put the CameraRig as a child and scale the parent. That doesn't seem to work for Oculus.
Any suggestions?
Thanks!
    This topic has been closed for replies.

    6 replies

    Inspiring
    April 11, 2020
    Hey, did you find a solution by chance? Please let me know.
    New Participant
    April 12, 2020
    Nope. 
    Inspiring
    April 12, 2020
    @matrix211v1 Man you're not going to believe it but I just found the solution : you need to scale OVRCameraRig AFTER entering Play mode, for example in the OnEnable function. That's it.
    New Participant
    April 12, 2020
    That is quite interesting. I believe I have tried it to scale it after hitting play and modifying it in the editor. Are you *sure* that your scaling the "OVRPlayerController" or a Parent GameObject of it? To me it is changing but it's just making the camera further away from the main of it's origin which gives the impression that it's smaller. 

    I could be and have known to be wrong.
    Inspiring
    April 12, 2020
    I am scaling the OVRCameraRig prefab instance itself. I does scale the world, not only distances. 100% sure :)
    New Participant
    June 5, 2021

    Scaling the OVRCameraRig prefab worked for me too.  Here's a script I used to test it out:

    using UnityEngine;
    
    public class ScalePlayer : MonoBehaviour
    {
        public GameObject cameraRig;
        public Vector3 defaultScale = new Vector3(1f, 1f, 1f);
        public Vector3 alternateScale = new Vector3(20f, 20f, 20f);
    
        bool scaled = false;
    
        void Update()
        {
            if (Input.GetButtonDown("Oculus_CrossPlatform_PrimaryIndexTrigger"))
            {
                ToggleScale();
            }
        }
    
        void ToggleScale()
        {
            if (scaled)
            {
                cameraRig.transform.localScale = defaultScale;
            } else
            {
                cameraRig.transform.localScale = alternateScale;
            }
            scaled = !scaled;
        }
    }