Oculus Touch local Rotation polarity is flipping - strange behavior

Hi I’m tracking the Oculus Touch Controllers in my game and noticed some very strange behaviour which I don’t understand.

Essentially I’m using code like this get rotational values from the Touych Controller to control my vehicle:

helicopter.VRInputYaw (gameObject.transform.localRotation.y * yawTwistAmount);

The behaviour I have noticed is the localRotations values polarity will flip if I rotate the controller in full 360-degree rotations on a pivot in real world space.

e.g. level starts and twisting the controller left will turn my craft left (Y values move in a negative direction), if then rotate/pitch the touch controller down and fully rotate it in a 360 circle the twisting of my controller to the left will now turn my craft to the right (Y values move in a positive direction but im still turning in the same direction as before).

Also, it’s worth noting this inversion of values is random on starting my game, sometimes my craft turns right others it turns left when twisting in same directions. My guess is it is due to the controller rotation values on spawning. Currently this is completely breaking my game.

Does anyone have any hints on what is occurring and how to get normal functionality as I have with my Vive Controllers? Thanks

Hey man, I had the same issue and this is how I solved it (honestly OVR should have an option to keep track of Flipped or Regular polarity via a bool, that would solve a lot):

int polarityReverser = 0;//Used to account for polarity switch in rotation calculations
Quaternion ControllerRotation = UnityEngine.XR.InputTracking.GetLocalRotation(UnityEngine.XR.XRNode.LeftHand);
// Left-Hand rotation (Changes polarity)

if (ControllerRotation.w < 0) { polarityReverser= 1; } else { polarityReverser= -1; } //Check if polarity changed

Quaternion temp = transform.localRotation;
temp.z = ControllerRotation.z * polarityReverser ; //When using Controller rotation make sure that I account for polarity
transform.localRotation = temp;

So yea the polarity of the rotation changes at some interval when the controller flips 360 degrees, but what I’ve noticed is that the w variable in the Quaternion of the Controller Rotation switches from positive to negative when the polarity changes, and that’s one way to track it. So I check if the w variable is positive or negative and then just multiply the axis that I wanna use for some Rotation by either 1 or -1 depending on it.