cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting and Switching Handedness

nick_batey_3
Honored Guest
In our game, we're trying to detect and switch the handedness.  I've found the basic information on the calls to get the information for which hand is set in the profile, but I can't find any more information on it.  We're having an issue where I detect the handedness setting, and I can set the handedness (using the toolset OVRPlayerController) to the left hand by moving the "TrackedRemote" object to the right or left hand anchor.  But, that's not working out.  The switch doesn't seem to happen, even though it does in the editor (by manually setting the "lefthanded" bool.

I'm not really looking for code assistance as much as I'm looking for more information.  Does anyone have a good resource for good info on how this works or an idea of what we've missed?  I've spent several hours searching.

We're working on the Go, in Unity 2018.2, and using the code below:

private void OnApplicationFocus(bool focus) {
        leftHanded = OVRInput.IsControllerConnected(OVRInput.Controller.LTrackedRemote);
        SetHandedness(leftHanded);
    }

public void SetHandedness(bool isLeftHanded) {
        if(isLeftHanded) {
            trackedRemoteRef.parent = leftHandAnchorRef;
        } else {
            trackedRemoteRef.parent = rightHandAnchorRef;
        }
    }


3 REPLIES 3

nick_batey_3
Honored Guest
After spending a little more time on it, I found a work around.  If you delay the call to OVRInput.IsControllerConnected, the call comes back correct.  I added in an invoke method with a short delay to accomplish it.

Anyone else seen this?  Is this best practice or am I missing something?

valerioPavanVR
Honored Guest
Hello @"nick.batey.3", hello @imperativity ,
I'd like to give to both of you my feedback on the correct intuition of nick about delaying the call.
I made some test and i found that the query works correctly only with values over 0.01sec.

This could solve our problem and i really appreciate your contribution, but i'm a little concerned about using an approximate parameter such as a delay.

There is some way to query the connection with the controller? This way we could call repeatedly the handedness query until the controller is not detected.

Please, let me know what you think  🙂




marksteelz3
Honored Guest
Hi @"nick.batey.3" and @valerioPavanVR

I'm also trying to switch handedness on the Go and came across this post, but I don't think this solution will work for me because I'm starting with the go controller as a right handed controller (as in that's the setting in Oculus Home), so checking to see whether the LTrackedRemote is connected will return false and then that will set the parent of the trackedRemoteRef to the rightHandAnchorRef. Do you know if it's possible to actually change the controller from being a right handed controller to a left handed controller when it starts as a right handed controller in the Oculus Home? Or would a left handed person have to go into Settings in the Oculus Home and change the controller to a left handed controller?