- Home /
Triggers on the 360 controller treated as one axis?
Hi, I've found that I can detect if the triggers on the 360 controller are pressed by looking at the joypad axis value for the 3rd axis on the joypad, however it does not work very well.
The value returned ranges from -1 to 1. If it is one the the right trigger is pressed, if it is -1 the left trigger is press. If no triggers are pressed or both triggers are pressed then the value returned will be zero.
This is no good as it is impossible to tell if both triggers are press or if neither of the triggers are pressed.
Is there a solution to this problem?
Answer by MOrlando · Feb 01, 2012 at 09:13 PM
In case anyone has problems with this on the Xbox360, you can use Axis 9 for the left trigger and Axis 10 for the right trigger. They both go from 0-1, of course, but you can access them individually. I haven't actually tested this on PC yet.
You can still access them together using Axis 3 in case you wanted to use them for brake and acceleration like Microsoft intended.
Also, I'm using 3.4.2f2 so it's possible I'm coming into this so late that the guys over at Unity already addressed this and I'm simply regurgitating that here.
I found it to be axis8 and axis9 (zero indexed), but you are correct and saved my day. Thank you kind sir :)
Answer by Maltus · Jan 19, 2011 at 04:38 PM
Well what I have done is set up one Input named trigger on axis 3 then invert it and now my left trigger is [0 to -1]and the right trigger is [0 to 1] if that helps.
Unfortunately this doesn't help if you need to hold down both triggers at once. It 'zeros out'.
Answer by alexnode · Sep 22, 2010 at 05:02 PM
I thought that the triggers were half axis from 0 to 1 not from -1 to 1 a.
here it says that it might be a bug .... forum
So how should I be polling for input from the 360 controller's triggers?
What settings should I have in the input manager?
From my experimentations I have only managed to detect the 360 controller triggers using:
Type: Joystick Axis Axis: 3rd axis
However this suffers from the problems described above :(
i haven't fix the triggers my self ... so i used other keys ins$$anonymous$$d .. i don't remember exactly what was the problem for me but i stuck in something similar ..