---
title: "Configuring an Xbox Controller for User Input - 2019.2"
content_type: tutorial
url: "https://learn.unity.com/tutorial/configuring-an-xbox-controller-for-user-input-2019-2?language=en"
language: en
difficulty: beginner
duration_minutes: 20
unity_version:
  - "2019.4"
supported_unity_versions:
  - name: "2019.4"
    url: "https://learn.unity.com/tutorial/configuring-an-xbox-controller-for-user-input-2019-2.md?language=en&version=2019.4"
  - name: "2019.2"
    url: "https://learn.unity.com/tutorial/configuring-an-xbox-controller-for-user-input-2019-2.md?language=en&version=2019.2"
last_updated: "2026-08-04T14:23:39.000Z"
---

# Configuring an Xbox Controller for User Input - 2019.2

Configure an Xbox controller in Unity and read its axes and button input in code through a simple example.

Configuring the Xbox controller in Unity, and accessing it in code, is relatively straightforward. In this tutorial, we’ll set up a simple scenario that uses the Xbox controller axes and buttons.

## 1. Configuring an Xbox Controller for User Input

Verified in 2019.3 - [https://learn.unity.com/tutorial/configuring-an-xbox-controller-for-user-input-2019-3](https://learn.unity.com/tutorial/configuring-an-xbox-controller-for-user-input-2019-3)

Configuring an Xbox controller for user input in Unity is easily achieved through Unity’s new **Input System**, available as an installable Package. In this tutorial, we will set up a simple scenario that uses the Xbox game controller buttons.

## 2. Installing the Input System Package

1\. From the Unity Editor’s top menu drop-down, select **Window** > **Package Manager**.

2\. In the **All Packages** column, select **Input System**, and select **Install** (**Figure 01**).

![Figure 01: Installing the Input System Package in the Package Manager Window](https://connect-mediagw.unity.com/h1/20201021/learn/images/021893d0-eb53-44f1-a2c9-cb895ad0c872_image8.png)

3\. You can verify your Project’s newly installed **Input System**, by opening up the **Project Settings**. Select from the top dropdown menu **Edit** > **Project Settings**. In the left column, select **Player**.  In the main window of the **Project Settings** Window, select **Other Settings** (**Figure 02**). Expand **Other Settings**, and scroll down to **Active Input Handling**.  Select either **Both**, or **Input System Package (New)** (**Figure 03**).

![Figure 02: Selecting the Other Settings of Player in the Project Settings Window.](https://connect-mediagw.unity.com/h1/20201021/learn/images/6ea8f6db-f11a-4cff-8615-cdbb1aa14da4_image3.png)

![Figure 03: Verifying the Active Input Handling to the New Input System Package.](https://connect-mediagw.unity.com/h1/20201021/learn/images/7b579e3c-af58-4e2b-bc13-721b372dee5c_image17.png)

## 3. Creating Your Custom Inputs

1\. Create a new **Input Action** by right-clicking in the Project Window, and select **Create** > **Input Actions**.  Rename the new **Input Action** to “**InputMaster**”.

2\. Double-click the newly created “**InputMaster**” in the Project Window, to open up the **Input Actions** Window.

3\. On the top left corner of the **Input Actions** Window, select the **No Control Schemes** dropdown, and then select **Add Control Scheme** (**Figure 04**).

![Figure 04: Adding a new Control Scheme](https://connect-mediagw.unity.com/h1/20201021/learn/images/18bca1c7-db51-429e-ab4a-5ed949c64f79_image9.png)

4\. In the **Add Control Scheme** Window, select the **+** button to create a new **Control Scheme,** and rename the **Scheme Name** to “**Xbox Control Scheme**” (**Figure 05**). Later, you can always create additional **Control Schemes** for adding other input sources, such as from the keyboard.

![Figure 05: Selecting the + button to add a new Control Scheme](https://connect-mediagw.unity.com/h1/20201021/learn/images/f2aea72e-2ce1-45cf-8d6c-51ab7877b5ec_image10.png)

5\. Within the menu, select **Gamepad** > **Xbox Controller** > **Xbox Controller** (**Figure 06**).

![Figure 06: Selecting the Xbox Controller](https://connect-mediagw.unity.com/h1/20201021/learn/images/676f73ad-856e-47ec-8c98-54e4655633df_image13.png)

6\. Next, in the **Add Control Scheme** Window, select **Save** (**Figure 07**).

![Figure 07: Saving the Xbox Control Scheme](https://connect-mediagw.unity.com/h1/20201021/learn/images/a785067c-bf02-4b58-aca8-4a3cb82ffc04_image19.png)

7\. Next, on the left **Action Maps** panel of the **Input Actions** Window, select the **+** button to create a **New Action Map**.  **Action Maps** are categories for how your inputs will be organized, for example, you might have separate **Action Map** categories for the player, menu-items, camera views, or vehicles.  Here, rename your **Action Map** to “**Player**”.

8\. A **New Action** has now been added to the middle **Actions** panel.  **Actions** are essentially events, such as a player running or jumping. Double-click the **New Action** and rename it to “**Jump**”. We will then **Bind** specific buttons on the gamepad controller to trigger each **Action**. Select the **+** button to the right of the ”**Jump**” **Action**, and then select **Add Binding** (**Figure 08**).

![Figure 08: Adding a Binding to a New Action](https://connect-mediagw.unity.com/h1/20201021/learn/images/bd28d8b2-faa8-4613-b85b-bf8946ca30c1_image11.png)

9\. Next, in the **Properties** panel of the “**InputMaster**” Window, select the **Binding Path** field (**Figure 09**).

![Figure 09: Selecting the Binding Path](https://connect-mediagw.unity.com/h1/20201021/learn/images/9f98c515-dcfb-4e80-8550-5a211aefeb82_image18.png)

10\. You will see a list of **Gamepad** buttons and controls.  Scroll all the way down to select the specific list of buttons for the **Xbox Controller** (**Figure 10**).

![Figure 10: Selecting the specific buttons to the Xbox Controller](https://connect-mediagw.unity.com/h1/20201021/learn/images/afe2db27-80ec-4f7f-9521-3e193dd45125_image4.png)

11\. Select the specific button for the **Xbox Controller** from the list of available choices. Alternatively, select the **Listen** button, and press the corresponding button on your controller itself (**Figure 11**).

![Figure 11: Selecting the Listen Button, awaiting the input from the Controller itself.](https://connect-mediagw.unity.com/h1/20201021/learn/images/4d9d4983-1cfa-4637-ab4a-4ad51f4c1580_image14.png)

12\. We can further assign controller **Actions** for player movement, much in the same way as the previous steps for triggering a jump with a button.  For the sake of efficiency, you can also set up an **Action** to encompass movement along 2 Vectors.  Here we will create a new **Action**, rename it to “**Movement**”, and select **Button** to change the **Action Type** (**Figure 12**).

![Figure 12: Selecting the Action Type Button.](https://connect-mediagw.unity.com/h1/20201021/learn/images/79fa2e91-98e9-47e2-b571-74f99c802e68_image16.png)

13\. Select **Pass Through** as the **Action Type**, and then select **Vector 2** for its **Control Type** (**Figure 13**).

![Figure 13: Selecting Vector 2 for the Control Type.](https://connect-mediagw.unity.com/h1/20201021/learn/images/3b070afc-0374-4bea-a405-622579fb55ff_image6.png)

14\. Now when you select the **+** button next to the **Movement Action**, you can select to add a **2D Vector Composite** (**Figure 14**).

![Figure 14: Selecting Add 2D Vector Composite.](https://connect-mediagw.unity.com/h1/20201021/learn/images/3b7d9d95-e38f-41c2-9810-1709b3756ecb_image7.png)

15\. Assign the Movement Vectors to the corresponding Xbox Controller inputs in the same manner as the previous steps (**Figure 15**).

![Figure 15: Selecting the corresponding Xbox Controller inputs.](https://connect-mediagw.unity.com/h1/20201021/learn/images/d996320d-1a74-4475-ba9b-d74c955cfa27_image12.png)

16\. Create any additional **Input Actions** you will need for your Project, exploring through the various features that the **Input System** offers. When finished, select **Save Asset**. For the full documentation of the **Input System**, follow this [link](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/index.html).

17\. We will now set up the **Player Input Component** to the Player. With the Player **GameObject** selected in the Hierarchy Window, select **Add Component** in the Inspector Window, and search for **Player Input** (**Figure 16**).

![Figure 16: Adding the Player Input Component to your Player.](https://connect-mediagw.unity.com/h1/20201021/learn/images/08450e4f-b460-47ea-b5aa-b2e28237c18e_image2.png)

18\. Next, Select the Object Picker Button to assign the **Input Actions** Asset we named “**InputMaster**”, to the **Player Input** Component (**Figure 17**).

![Figure 17: Selecting the Object Picker Button to assign the InputMaster Asset to the Player Input.](https://connect-mediagw.unity.com/h1/20201021/learn/images/d69c4bbe-f1c4-4185-bb9f-afb3f796357b_image20.png)

19\. Next, assign the **Default Scheme** to the **Xbox Control Scheme**, and assign the **Default Map** to **Player** (**Figure 18**).

![Figure 18: Assigning the Default Scheme and Default Map.](https://connect-mediagw.unity.com/h1/20201021/learn/images/973eeeab-c6c5-4e1b-b7ef-23f351be1503_image5.png)

20\. Lastly, the **Input System** will generate the C# Script for your **Input Actions** for further modification of your Project’s needs. Select “**InputMaster**” from the Project Window, select the **Generate C# Class** checkbox in the Inspector Window, and select **Apply** (**Figure 19**).

![Figure 19: Generating the C# Script.](https://connect-mediagw.unity.com/h1/20201021/learn/images/f7147cdd-a593-41f4-806d-25bf3cbee47c_image1.png)

21\. The resulting code is saved as a C# Script, with the saved name of “**InputMaster.cs**” (**Figure 20**).

![Figure 20: The Generated C# Script.](https://connect-mediagw.unity.com/h1/20201021/learn/images/ebde151c-06f4-4b2c-a99a-b50b999fc177_image15.png)

22\. Enter **Play Mode** and test out your Project’s Xbox Game Controller inputs. Your individual project will determine which **Input Action** is more appropriate based on the desired feel.

## 4. Conclusion

The Xbox game controller is easy to configure and use within Unity's **Input System** Package.  The **Input System** enables a variety of input control options to bind to your specific Xbox game controller’s buttons.
