cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED?]Oculus Touch Controller detection. Bug on OVRInput?

albmarvil
Explorer
Hello everyone!

I am currently working with the touch controllers and how they behave when they are disconnected. In our game we support several input devices but if that device is disconnected, the user is able to keep playing using only gaze controls.

First of all info about the development environment:
-Unity 5.4.2f2
-Oculus Utilities v1.8.0
-OVRPlugin v1.8.0
-SDK v1.10.0

My current problem is that I am not able to detect when one of the touch controllers has run out of battery or the user removes the batteries. When one of the controller is running out of battery, the universal menu appears with a message about the touch battery. If the controller has run out of battery it gets disconnected and you can see that in the control panel on top of that screen. 

For the touch controller detection I am using the following code:

bool GetTouchControllerConnected()
{
OVRInput.Controller controllersConnected = OVRInput.GetConnectedControllers();

bool leftTouchConnected = (controllersConnected & OVRInput.Controller.LTouch) != OVRInput.Controller.None;
bool rightTouchConnected = (controllersConnected & OVRInput.Controller.RTouch) != OVRInput.Controller.None;

return leftTouchConnected && rightTouchConnected;
}
After one of the touch controllers gets disconnected due to battery problems, the variable controllersConnected still returns the value OVRInput.Controller.Touch (LTouch | RTouch), even if the Oculus Universal Menu says that one touch controller is missing.

Also another problem that I have realized after testing a lot is that the method OVRInput.GetConnectedControllers() returns that the touch controlles are connected even if you remove the devices using the settings menu in the Oculus App (aka "Forget Device").

I need some light here from the Oculus devs, because the game is unplayable after disconnecting one touch controller, forcing the user to change batteries, restart the game or even set-up again a new controller.


EDIT

It's officially broken. Just wait for the fix.

https://developer3.oculus.com/downloads/game-engines/1.10.0/Oculus_Utilities_for_Unity_5/


1 REPLY 1

jumbli
Heroic Explorer
I assume that runtime fix will resolve the problem for Unreal games too. I noticed that the state of the controllers seemed to require using the reboot option in Oculus Home to update them in the API. In the short term I've added a menu option to allow the user to disable tracked controllers. They can then continue with a gamepad + gaze based aiming until they charge their batteries.
Developer of Dimensional, The Relentless, Breath Tech, Jigsaw 360 View my dev blog at JumbliVR.com