Unity xbox controller input - left trigger issue

Discussion in 'Editor & General Support' started by Davidw123, Apr 18, 2013.

  1. Davidw123

    Davidw123

    New Member

    Joined:
    Jan 18, 2013
    Messages:
    43
    Hi guys,

    trying to work out how to implement an xbox controller to my game. At the moment, ive simply plugged it in, adjusted the inputs to the required button names etc and it works fine; however have no idea how to implement the left and right triggers - i know they work on a 3rd axis but what do i actually do!?

    Cheers!
     
  2. Davidw123

    Davidw123

    New Member

    Joined:
    Jan 18, 2013
    Messages:
    43
  3. mafavreau

    mafavreau

    New Member

    Joined:
    Oct 16, 2010
    Messages:
    8
    We are actually experiencing the same problem here...

    I've found posts that says it's 3rd axis (XBOX?) others that it's 9th or 10th (I think those are for OSX)

    I've tested my XBOX controller outside of Unity and it works fine

    I've tested my controller with XInput.net test plugin made by MIT students and that works with my XBOX controller in Unity... yet I cannot get it to work in my own project...

    No luck!

    The actual how-to to this ought to be written in the sky in letters of fire!
     
  4. Arowx

    Arowx

    Member

    Joined:
    Nov 12, 2009
    Messages:
    2,608
    Hi guys got mine working by checking out unity answers.

    It's odd as in it's on the third axis and the one trigger is positive and the other is negative so you can't press both together and have to compensate for the return value!

    My setup for triggers for thruster and fire button.

    [​IMG]
     

    Attached Files:

  5. fasfasdfff

    fasfasdfff

    New Member

    Joined:
    Dec 11, 2012
    Messages:
    1
    You can use the 9th and 10th axis to get the Left and Right trigger respectively.

    I wrote a wrapper class for gamepad input in attempt to circumvent future headaches.
    Gamepad.GetTrigger(Gamepad.Trigger.LeftTrigger);
    You can find it here.