Setting up Action Maps

This doc goes into how to setup Action Maps, Actions, and Bindings in the New Input System in Unity 6.3 ...

  • Go to 'Edit / Project Settings / Input System Package'.

Getting to the New Input System Settings...
  • There will most likely be several Action Map examples by default, such as Player, UI etc.

  • Select the 'Player' Action Map.

  • Under each Action, such as 'Move', 'Look', and 'Attack', you can see the controller inputs for that action. It is easy to add, edit, or remove different controllers to the actions. These inputs are called Bindings. The Action is what you will reference in the code, not the controllers.

    • As an example, the 'Move' Action has the following bindings :

      • Left stick on the gamepad

      • WASD on the keyboard

      • Primary2DAxis on the XRController

      • Stick on a joystick.

  • Each action has an input type to the right of the window, such as a Value, Button, or Passthrough.

    • Value - A value from a single controller input that can be an Axis, Vector2, Vector3, and many others types.

    • Button - is just a button, initially defined as a 0 or 1. It can be accessed as a true/false statement or boolean.

    • Passthrough - A value that can be pulled in from various controller inputs at once.

Creating an Action Map

You can use the Action Maps that are already setup or create your own, for the purposes of this tutorial lets create a new Action Map.

  • Select the Plus icon at the top right of the 'Action Maps' section.

  • Rename the new Action Map as you like by double clicking the text.

    • You can also use 'Right click / Rename'. Note you can also Duplicate, Delete, Cut, Copy, or paste as well.

Creating Actions

  • Select the new Action Map, select the 'Plus' Icon at the top right of the 'Actions' section.

  • Rename the new Action as you like by double clicking the text.

    • Use can also use 'Right click / Rename'. Note you can also Duplicate, Delete, Cut, Copy, or paste as well.

  • Select what kind of Action Type the Action uses scuh as Value, Button or Passthrough.

    • Use Value for things like thumbsticks and values that are not 0 or 1.

      • Under Value, select what kind of variable in the 'Control Type' parameter you would like. Vector2 would be a common example.

    • Use Button for things that are buttons...such as A,B, X, or Y on a gamepad.

      • 'Initial State Check' determines if an action should immediately trigger based on the current state of its bound controls when first enabled, rather than waiting for the next change in input.

    • Use Passthrough if you know what you are doing and plan to have the one input be triggered from multiple sources.

Creating Bindings

  • Expand the new Action, with the arrow to the left. You will see '<No Binding>'.

  • Select the '<No Binding>', click on the 'Path' parameter on the 'Binding Properties' section on the right.

  • There are two ways to input controls to a Binding :

    • Using the 'Listen' Button.

      • Select the 'Listen' button and press the controller or key directly.

    • Select the target device manually.

      • Select the device you would like to use, eg. 'Gamepad'.

      • Select the category of button you would like to use, eg. 'Left Trigger'.

      • Note that the four main buttons on a controller are used as North, South, West or East...making this easier to understand no matter what gamepad you are using.

  • Once you have selected an interaction you can see what devices are derived from that device type under the Path parameter.

  • 'Use in Control Schemes' defines the device within a device type. So far, I have found this to be optional, but depends on your use case.

  • If you click on the 'T' icon next to the Path parameter you can get the device text in its script format if you need this for any reason.

Last updated