
Choose a name and folder inside the Assets folder of your Project (or just accept the defaults) and select Okay.

When you click the Create Actions button, Unity asks you where to create the new Asset. This creates an Asset pre-populated with a default set of Input Action Maps, Input Actions, and Input Bindings. The quickest way to create a new set of Actions is to click the Create Actions… button in the Inspector window for that component. To receive input, the component must be connected to a set of Input Actions. To add this component, click the Add Component button in the GameObject Inspector:Įach PlayerInput component represents one player in the game. The easiest way to do this is to use the PlayerInput component. That also makes it harder to later change which Device Control triggers a specific event in the game.Īlternatively, you can use Actions as an intermediary between Devices and the in-game responses they trigger. Getting input directly from an Input Device is quick and convenient, but requires a separate path for each type of Device. To get input directly through an Input Action, follow these steps: Getting input indirectly through an Input Action The same approach works for other Device types (for example, Keyboard.current or Mouse.current). Public class MyPlayerScript : MonoBehaviour For example, the following code gets the gamepad that a player last used, and reads its current state: using UnityEngine The quickest way to get started in script is to read the current state directly from Input Devices. Getting input directly from an Input Device

Note: For information on how to install the new Input System, see Installation.
