Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  6. Unity 2017.2 beta is now available for download.
    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:
    5,779
    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

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