x


360 Trigger Pressing both Triggers at the same time

So, I am sorry if this is answered, but I am using the Left Trigger and Right Triggers on my 360 controller to fire the left and right weapons accordingly. So I have

if(Input.GetAxis("P1Trigger") == 1){
FireLeft();
}

if(Input.GetAxis("P1Trigger") == -1){
FireRight();
}

When they aren't pressed the 3rd Axis is 0, but it seems that when both are pressed the 3rd Axis is also 0. I know that if I create P1LtTrigger and P1RtTrigger and invert 1 of them I can get them to fire both on one trigger press, but that's not what I am need.

more ▼

asked Apr 03 '11 at 08:11 PM

Adam 10 gravatar image

Adam 10
27 13 15 16

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Can you seperate your axis in the input section. so instead of P1Trigger you will have P1LeftTrigger and P1RightTrigger

http://answers.unity3d.com/questions/21111/triggers-on-the-360-controller-treated-as-one-axis

http://answers.unity3d.com/questions/581/what-are-all-the-joystick-buttons-for-an-xbox-360-pc-controller

this questions been bugging me so I looked into it a bit more and found this http://speps.fr/xinputdotnet which is a website for a piece of 3rd party software which (i believe) allows you to skip over the DirectInput that Unity uses to map controllers and uses XInput instead.

more ▼

answered Apr 03 '11 at 09:12 PM

AngryOldMan gravatar image

AngryOldMan
2.6k 12 21 47

How do you separate the axis if the triggers are the 3rd Axis by putting them separate and still selecting 3rd Axis you still are doing the same thing aren't you?

Apr 03 '11 at 10:24 PM Adam 10

Did you even try it before posting that comment? They are only supposed to be mapped between 0 and 1. Take a look at the other questions regarding this matter. Update in answer

Apr 03 '11 at 11:06 PM AngryOldMan

Well clearly I had tried that since in my Question I have indicated putting PlLtTrigger and P1RtTrigger, but I apparently don't understand the mapping. For Axis you choose 3rd as that's the trigger and according to what I have read its -1 0 1, so I don't understand.

Apr 03 '11 at 11:13 PM Adam 10

read the updated post,people have had the same problem. Not sure if there is a solution but give them a try, maybe you will work something out in doing so.

Apr 04 '11 at 12:27 AM AngryOldMan

Alright Ill keep messing with it, I was working another issue, but thanks for trying to clear it up for me.

Apr 04 '11 at 01:32 AM Adam 10
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x981
x549
x329
x223
x62

asked: Apr 03 '11 at 08:11 PM

Seen: 1518 times

Last Updated: Jul 18 '11 at 09:13 PM