Forum Discussion
matrix211v1
6 years agoHonored Guest
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!
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!
6 Replies
Replies have been turned off for this discussion
- Florian.BRINKProtegeHey, did you find a solution by chance? Please let me know.
- matrix211v1Honored GuestNope.
- Florian.BRINKProtege@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.
- matrix211v1Honored GuestThat 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. - Florian.BRINKProtegeI am scaling the OVRCameraRig prefab instance itself. I does scale the world, not only distances. 100% sure :)
- JerryMeTwoHonored Guest
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; } }
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 8 months ago
- 6 months ago