Forum Discussion
DTNA_VR
2 years agoExplorer
OVRManager.display returning null
Problem: I'm trying to set my Quest 2 headset to 120hz, Calling OVRManager.display returns null
Details:
I imported the Oculus Integration Plugin then wrote the below code, but when I build and deploy to the headset I get a null reference exception because OVRManager.display returns nulls
Additional Info:
Unity 2021.3.12f1, building for the Quest 2, I have Quest support disabled.
Oculus XR Plugin V3.0.2
XR Plugin Management V4.2.1
Oculus Integration V49.0
BNG VR Interaction Framework 1.82
Thanks in advance for any help!
Thanks for the comment, I could not figure it out so I ended up using the Unity XR plugin to change the refresh rate
3 Replies
Replies have been turned off for this discussion
- ChescoRedStart Partner
Hello, I think the problem is that it is not going through all the frequencies that it collects in "freq" try this.
private float[] _freqs; private float _freqsSelect; private void Start() { _freqs = OVRManager.display.displayFrequenciesAvailable; _freqsSelect = _freqs[0]; CheckFrequencyDevice(_freqs); } // In this function it loops through all the frequencies returned by OVRManager.display.displayFrequenciesAvailable private void CheckFrequencyDevice(float[] f) { for (int i = 0; i < f.Length; i++) { if (f[i] > _freqsSelect) { _controllerProgressBar.LoadTMPProgressBar(2.0F); _freqsSelect = f[i]; } } //Here you can choose the frequency you want. In my case, if it has returned one of more than 90, it means that there is a frequency of 120 and I send it to another function for its assignment. (You can make it more elegant than the example case) if(_freqsSelect > 90.0F) { ToAssingFrequencyDevice(120.0F); } else { ToAssingFrequencyDevice(70.0F); } } private void ToAssingFrequencyDevice(float hz) { OVRPlugin.systemDisplayFrequency = hz; }Greetings and I hope it works for you.
- DTNA_VRExplorer
Thanks for the comment, I could not figure it out so I ended up using the Unity XR plugin to change the refresh rate
- AmrSolExplorer
How? can you share the code with us?
i can't set the refresh rate to 120 hz on quest 3 (OS ver66 )
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
- 3 years ago
- 5 years ago