Search Unity

XBox Controller - Left and Right Bumper Buttons

Discussion in 'Scripting' started by Senkusha, Dec 15, 2011.

  1. Senkusha

    Senkusha

    Joined:
    Mar 28, 2011
    Posts:
    98
    I believe I have my inputs mapped correctly (joystick button 6 and 7), however, when I push these buttons in game, in the Debug.Log I see a Null ReferenceException Error instead of my "Pressed Left Bumper" text. Does anybody know why?

    Code (csharp):
    1.  
    2. if (Input.GetButton("Left Bumper"))
    3.     Debug.Log("Left Bumper");
    4. if (Input.GetButton("Right Bumper"))
    5.     Debug.Log("Right Bumper");
    6.  
     
  2. ryand-unity

    ryand-unity

    Joined:
    Jan 21, 2011
    Posts:
    547
  3. ryand-unity

    ryand-unity

    Joined:
    Jan 21, 2011
    Posts:
    547
    I will Map A Xbox Controller for you and send you all the INFO on it.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    do you talk about the triggers (L1 / R1) or about the bumpers? the later are no buttons they are joystick axis as they send more than 'pressed / not pressed'
     
  5. Senkusha

    Senkusha

    Joined:
    Mar 28, 2011
    Posts:
    98
    These are the buttons R1 and L1
     
  6. ryand-unity

    ryand-unity

    Joined:
    Jan 21, 2011
    Posts:
    547
    here is your Xbox map i do not know what the Directional Pad is but here is the rest.
    $microsoft_xbox_360 Button Map.jpg

    the bumper button are the LB and RB on the map.
     
  7. Senkusha

    Senkusha

    Joined:
    Mar 28, 2011
    Posts:
    98
    Yup, that's what I've got the L1 and R1 buttons set as, Xbuttons 5 and 6, still I get ReferenceException Error when I push these two buttons.
     
  8. ryand-unity

    ryand-unity

    Joined:
    Jan 21, 2011
    Posts:
    547
    mmm
     
    Last edited: Dec 15, 2011
  9. Ender

    Ender

    Joined:
    Jun 3, 2011
    Posts:
    72
    maybe it has to do with the version of the controller. Is it really old?
     
  10. MetaPsychosis

    MetaPsychosis

    Joined:
    Dec 7, 2011
    Posts:
    31
    Perhaps you need to make sure that you have the default drivers installed for your xbox controller, and not some custom job.
     
  11. Senkusha

    Senkusha

    Joined:
    Mar 28, 2011
    Posts:
    98
    I have the latest drivers, oh and I am using JoyInMotion with my PS3 controller set to using the default Xbox emulation button mappings. When testing these buttons in control pane (Windows 7) I do see the display light up, indicating the buttons are being pressed. When iin Unity, the input manager recognizes that I am pressing these two buttons, but I get a NullReferenceException error instad of my debut text (Left Bumper or Right Bumper).
     
  12. Deleted User

    Deleted User

    Guest

    1. Is the Xbox one controller map buttons..the same as the 360