- Home /
How to get individual trigger input using Xbox 360 controller?
Hey all,
I've been wanting to do some stuff with Xbox 360 controllers and was going through and setting up a basic debug scene based off the material found here : http://wiki.unity3d.com/index.php?title=Xbox360Controller
Now I understand that to get the way the triggers normally work you use the "3rd axis" this gets both of the trigger inputs as a range between -1 - +1 with each trigger cancelling each other out when pressed. I have this version working so far.
I know to get the individual triggers I am supposed to use the 9th and 10th joystick axis instead. For some reason when I set it up to do so, even using the same input manager that is in the website it does not work. I might be missing some simple step but currently I am unsure what to do as I get no feed back on the triggers when using axis 9 and 10.
I am using Unity 4.3 currently.
Answer by markmmiller · Nov 29, 2013 at 06:47 PM
Fixed. For some reason after running the application from within the editor I had to make sure the focus was specifically inside the game window. Every other control was working whilst focus was outside of the window but only once I clicked inside did the triggers work.
Also switched over to Xinput to get rumble working. https://github.com/speps/XInputDotNet
So using the 9th axis and 10th axis worked for both triggers. Verry Good to know thanks.
I just wanted to add that you have to also set the 'Joy Num' in the Input Inspector options. The default is 'Get $$anonymous$$otion from all Joysticks' and you have to change it to a specific Joystick in the dropdown to receive any value from the 9th and 10th axes. Thanks!
Answer by TheOnly1ZombieGamer · Apr 03, 2018 at 10:33 PM
I actually need a little help with this, i am using a Xbox One controller in unity and i have everything working except for the triggers, im trying to use RT with Fire 1 for a attack but when i set it to Joystick Axis, Axis as 10, and Joy Num as a random joystick number i still get no response from the trigger. please help me.
Answer by KeithW · Jun 01, 2018 at 06:24 PM
@TheOnly1ZombieGamer For right trigger, my settings are
Name: Fire 1
Gravity: 1000
Dead: 0.2
Sensitivity: 1000
Snap: checked
Type: Joystick Axis
Axis: 10th Axis
Joy Num: Get Motion from all Joysticks
Everything else is blank.
If you are setting Joy num to a "random" joystick number, it will not work unless you have that many joysticks and are testing the correctly numbered joystick. So, either set it to Joystick 1 or All Joysticks.
Also, to get responses from the 9th or 10th axis, you must click in the game window to make it active in the editor.
Your answer
Follow this Question
Related Questions
Can't get Triggers to Work [Solved] 1 Answer
PAD Xbox 360 0 Answers
Input Snap option not returning 0? 0 Answers
Approach for forcing player movement 0 Answers