Xbox Controller and Input.GetButtonDown( );

Hey there,

I’ve searched around for this problem and couldn’t find anything on this particular issue so sorry for a dupe if this is one.

However, in our game when getting the controller input everything works perfectly as long as the method is Input.GetButton. However, if the method is changed to Input.GetButtonDown() it suddenly stops working.

As sample of our code:

    public void Update( )
    {
        bool test = Input.GetButtonDown( "EBrake_1" );
        if( test )
        {
            Debug.Log( "Get Key Working" );
        }
    }

And the working code:

    public void Update( )
    {
        bool test = Input.GetButton( "EBrake_1" );
        if( test )
        {
            Debug.Log( "Get Key Working" );
        }
    }

I’m not too sure what the issue is, I’ve tried storing them in variables, calling them directly, etc. The only thing I can think of is that the GetButtonDown method doesn’t work with xbox one controller.

Probably too late to reply, but I just tried changing my Input in input Manager to “Key or Mouse Button” instead of “Joystick Axis” and it works like a charm. :smiley:

http://wiki.unity3d.com/index.php?title=Xbox360Controller

And use Input.GetKeyDown("joystick button 0")

if anyone still has the same problem
just follow this wiki http://wiki.unity3d.com/index.php?title=Xbox360Controller
edit > project settings > input > then follow the instructions from the site.