Gamepad control on android problem

Hi, I would like for my game, control the player with gamepad on android but I use

if(Input.GetButton(“joystick button 0”){
//Do something
}

on my computer it work ( the gamepad is connected by USB )
but when I play on android device nothing happenned ( the gamepad is compatible with my tablet ( I Start the game with the game pad))

Please help me :slight_smile:
Regard. Titanics tutos

Confirm the button name, my joystick button 0 on unity was the joystick button 15 on android.

Here is a simple code you can use, attach this to any game object:

public class JoystickTest : MonoBehaviour {

    private string joystickButton;

    private void OnGUI()
    {
        GUIStyle style = new GUIStyle("Label");
        style.fontSize = 60;        
        GUI.Label(new Rect(Screen.width / 2 - 100f, Screen.height / 2, 500f, 500f), joystickButton, style);
    }

    // Update is called once per frame
    void Update () {
        for (int i = 0; i < 20; i++)
        {
            if (Input.GetKeyDown("joystick button " + i))
            {
                joystickButton = "joystick button " + i;
            }
        }
	}
}