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?
Look at the Input mapping in Project Settings->Input, somewhere "Y" and "Menu" might be defined?
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;
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.