10-08-2021 12:33 PM
So I use unity's older input mapping and it worked fine for years, but now all of a suddon, pressing the y button also registers the menu button as being pressed. Pressing the menu button does not register the y button as pressed though.
So when Input.GetButtonDown("Y") returns true, Input.GetButtonDown("Menu") always returns true too! Very annoying! anyone have any clue about this?
10-16-2021 06:53 AM - edited 10-16-2021 07:00 AM
Look at the Input mapping in Project Settings->Input, somewhere "Y" and "Menu" might be defined?
Unity 2019.2:
I used Input.GetKey(KeyCode.JoystickButton6) for menu button (i.e Back) and Input.GetButton("Button3") for Y button (on touch controller), but on Touch controller X and Y were swapped compared to XBox controller. And to support many different devices with the same kind of mapping became very hard, so
If it's not too much trouble I would go over to the new input system.
Unity 2021.1, I have code like this:
using UnityEngine.XR;
using UnityEngine.InputSystem;
UnityEngine.XR.InputDevice handRDevice = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
UnityEngine.XR.InputDevice handLDevice = InputDevices.GetDeviceAtXRNode(XRNode.LeftHand);
bool button1RSupported = handRDevice.TryGetFeatureValue(
UnityEngine.XR.CommonUsages.primaryButton, out bool button1R);
...
Gamepad gamepad = Gamepad.current;
if (gamepad != null) bBackButton = gamepad.selectButton.isPressed;
11-04-2021 04:48 PM
Hey, did you ever find a solution for this? I am experiencing the same issue and I can't figure it out. I am using the new input system and OpenXR. I have it mapped in an input mapping file and then I am using the "Player Input" behavior to link the event from that input mapping to a function in my script, but that function gets called when pressing Start or Y.
I also don't see any input options under the project settings as the other user suggested.