06-16-2022 07:33 AM
Hey,
I'm working on a VR game using Unity and the Quest 2 headset. I'd like to get in-app access to the battery level of each device (headset, left controller, right controller) independently.
I managed to get acces to the headset's battery level using Unity's built-in SystemInfo.batteryLevel (OVR.batteryLevel is flagged as obsolete and doesn't work), but I can't find a way to get access the the battery level of the controllers. OVRInput.GetControllerBatteryPercentRemaining() always returns 0 regardless of the argument I use.
Additionally, I would like to get access to further headset-related information such as serial number or nickname. So far, none of the answers I've found online have helped; apparently this used to work but now always returns "unknown":
AndroidJavaObject jo = new("android.os.Build");
float serialNumber = jo.GetStatic<string>("SERIAL");
Documentation is sparce, so I'm kinda stumped. Assistance would be greatly appreciated. Cheers!
06-16-2022 02:49 PM
Not actually tried this on Quest, but it works on Android: Unity - Scripting API: SystemInfo.deviceUniqueIdentifier
Alternatively, who know what this returns on Quest. Might be worth a try: https://forum.unity.com/threads/how-to-get-imei-of-android-phone-in-unity.538135/#post-3547395
09-19-2022 07:45 AM
Hello AnAerVR, Did you manage to get Oculus Quest 2 controllers battery level? Thanks!