1. Unity 5.6 is now released.
    Dismiss Notice
  2. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  3. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice
  4. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  5. The launcher is currently pulling earlier versions of the content packages which may have errors, see post.
    Dismiss Notice
  6. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  7. Check out all the fixes for 5.5 in patch releases 1 & 2.
    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,437
    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.