Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity xbox controller input - left trigger issue

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

  1. Davidw123

    Davidw123

    Joined:
    Jan 18, 2013
    Posts:
    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

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

    mafavreau

    Joined:
    Oct 16, 2010
    Posts:
    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

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    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.

     

    Attached Files:

  5. nekropantz

    nekropantz

    Joined:
    Dec 11, 2012
    Posts:
    15
    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.