Skip to content

Commit d78fc6e

Browse files
committed
Invert Y axis for touchpad and thumbstick, so they'll work the same as other XR Providers in Unity
1 parent 9d1e8c8 commit d78fc6e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Build/webxr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,13 @@
587587
controller.touchpadX = inputSource.gamepad.axes[j];
588588
break;
589589
case 1:
590-
controller.touchpadY = inputSource.gamepad.axes[j];
590+
controller.touchpadY = -inputSource.gamepad.axes[j];
591591
break;
592592
case 2:
593593
controller.thumbstickX = inputSource.gamepad.axes[j];
594594
break;
595595
case 3:
596-
controller.thumbstickY = inputSource.gamepad.axes[j];
596+
controller.thumbstickY = -inputSource.gamepad.axes[j];
597597
break;
598598
}
599599
}

Packages/webxr/Hidden~/WebGLTemplates/WebXR/webxr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,13 @@
587587
controller.touchpadX = inputSource.gamepad.axes[j];
588588
break;
589589
case 1:
590-
controller.touchpadY = inputSource.gamepad.axes[j];
590+
controller.touchpadY = -inputSource.gamepad.axes[j];
591591
break;
592592
case 2:
593593
controller.thumbstickX = inputSource.gamepad.axes[j];
594594
break;
595595
case 3:
596-
controller.thumbstickY = inputSource.gamepad.axes[j];
596+
controller.thumbstickY = -inputSource.gamepad.axes[j];
597597
break;
598598
}
599599
}

Packages/webxr/Hidden~/WebGLTemplates/WebXRFullView/webxr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,13 @@
587587
controller.touchpadX = inputSource.gamepad.axes[j];
588588
break;
589589
case 1:
590-
controller.touchpadY = inputSource.gamepad.axes[j];
590+
controller.touchpadY = -inputSource.gamepad.axes[j];
591591
break;
592592
case 2:
593593
controller.thumbstickX = inputSource.gamepad.axes[j];
594594
break;
595595
case 3:
596-
controller.thumbstickY = inputSource.gamepad.axes[j];
596+
controller.thumbstickY = -inputSource.gamepad.axes[j];
597597
break;
598598
}
599599
}

0 commit comments

Comments
 (0)