- Home /
Controller trigger problem
Hello,
I'm making a game where you'll be able to play on a PC or Mac with either an xbox or PS3 controller. I've found different drivers that work with each variation but the problem I have is that the triggers are mapped differently for each driver.
Mac with PS3 Controller: The PS3 controller works natively with Mac 10.6 and up so if at all possible I'd like to refrain from having to find a new driver. The problem is the triggers are mapped to "joystick button 8" and "joystick button9" when it should be mapped to an axis. Because of this the value of each trigger can only be either 0 or 1 so it's not pressure sensitive.
Mac with xbox Controller I'm using the Tattiebogle driver for the xbox controller on a mac. The triggers are mapped to the 5th and 6th axes. No complaints here.
PC with xbox or PS3 controller I'm using the MotionJoy driver for the xbox and PS3 controller on a PC. It's a bitch to get it started compared to the Mac but that's not the real issue. The triggers are both mapped to the 3rd axis. L2 is 0 to 1 and R2 is 0 to -1. This is kind of cool but there's no way of telling if the user is holding down both triggers. I'll probably need to find a new driver for PC but from what I've read MotionJoy is the best. And it sucks IMO.
Unity should really have their own drivers download automatically when you download the Unity player.
Answer by Ingen · Aug 04, 2012 at 02:57 AM
go to input manager, To see the Input Manager choose: Edit->Project Settings->Input.
http://docs.unity3d.com/Documentation/Components/class-InputManager.html
http://docs.unity3d.com/Documentation/Manual/Input.html
and give to input same name i.e. "Fire1" "Fire2" "Jump" and other are presetting. but you can easily add other increasing size and use it for input
Input.GetButtonDown ("Fire1")
this should work
I know about the Input manager...
What I'm saying is the drivers I'm using each have different mappings. so for example the "start" button will be mapped to "joystick button 10" with the Tattiebogle driver but it'll be "joystick button 6" with the $$anonymous$$otionJoy driver which is what users must use for PC.
I've written a script that chooses which button to assign "start" to based on if you choose $$anonymous$$ac/PC and Xbox/PS3 at the start of the game. I had to do this because you can't change anything in the Input manager at runtime for some stupid reason. btw vote for the feedback
http://feedback.unity3d.com/unity/all-categories/1/top/active/scripting-expose-input-manager-
Now my problem is with the triggers. $$anonymous$$ac natively maps L2 and R2 to buttons 8 and 9 when they should be axes, Tattiebogle maps to axes 5 and 6 and $$anonymous$$otionJoy maps both to 3rd. L2 being 0 to 1 and R2 being 0 to -1.
$$anonymous$$y question is how do I get the triggers to act consistently? One driver makes them true/false, another maps them separately the way they're supposed to, and the other maps them as one axis so there's no way of telling if both triggers are being held.
I'm having the same problem with L2/R2 (PC) did you manage to find a solution for this? Thanks in advance!
Answer by KingMaharg · Oct 20, 2014 at 11:08 PM
The left and right triggers for PC are also mapped separately as the 9th and 10th axes respectively. Both got from 0-1. You should be able to use them just as you do on Mac from there.
Your answer
Follow this Question
Related Questions
Best use of GetButton 4 Answers
How to map input for new Samsung Gear VR controller? 3 Answers
How to achieve rumble/vibrate for Xb360 gamepad? 0 Answers
Are the controllers mapped the same? 0 Answers