Forum Discussion

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

Battery percent remaining always returns 0%

After the update to branch ue4.27 v57  the function GetControllerState always returns 0%. I was trying to use GetControllerState6 as well as GetControllerState4 which I used earlier. 
GetControllerState6 returns a successful result. 
I have tested it on both quest2 and quest3.

Am I doing something wrong?
mt code

 

 

bool UOculusFunctionLibrary::GetControllersBatteryLevel(int& OutLeftController, int& OutRightController)
{
#if OCULUS_HMD_SUPPORTED_PLATFORMS
	ovrpControllerState6 ControllerState;
	if (OVRP_SUCCESS(FOculusHMDModule::GetPluginWrapper().GetControllerState6(ovrpController_Touch, &ControllerState)))
	{
		OutLeftController = ControllerState.BatteryPercentRemaining[0];
		OutRightController = ControllerState.BatteryPercentRemaining[1];
		return true;
	}
#endif
	return false;
}

 

 



Replies have been turned off for this discussion