xbox gamepad trigger handling in editor versus windows standalone
I'm currently using Unity 2021.1.22f1. The gamepad claims to be a Hyperkin X91. I only have one gamepad hooked and its by USB. My machine is running Windows 10.
My project is responding to the the gamepad triggers (used to activate pinball paddles) when in the editor using Gamepad.current.rightTrigger.isPressed but the Gamepad.current variable is null when I run the windows stand alone version. As a work around for the Windows standlone, I can go into the input manager, set one of the Axes (like Fire1) is to be type Joystick Axis Axis 3rd Axis and if I do a Input.GetAxis("Fire1") it wil return -1 for left trigger, and +1 for right trigger, but I don't see a way to distinguish between both triggers being held simultaneously and neither triggers not being pressed (both cases return a value of 0.
What is the proper way of handling events from a gamepad, that works regardless of whether you are in the editor or built version of your project?
Thank you.
Your answer

Follow this Question
Related Questions
Right trigger on XboxOne Controller not working 0 Answers
UNITY no longer detecting XBOX360 controller input,XBOX 360 controller no longer working with UNITY 0 Answers
Xbox joystick ID 1 Answer
how to rotate spirte towards the mouse or by the xbox controller at the same time 0 Answers
Is it possible to spawn players based on joystick button placement? 1 Answer