The new Input System: Create your first input asset

let’s go back to our main topic the new input system, we have installed the package correctly, modified the Unity settings now we can start to create our first input asset.

As always order is essential in a project so I recommend you create a folder for this type of item when you use this tool.
So once created the folder let’s select the corresponding item to create a new Input Action.

Clicking on the newly created object should open a new editor window. We should find ourselves at a window with three columns that we are now going to exploit.

In the first column, we see the Action Map, which is the set of commands that we can activate and use during the game, take for example a game where you can use a character that moves and runs or you can use a car or a motorcycle. The movement commands can be different. Another example is the commands we can have in a menu when we pause the game compared to when we are playing.

Action Maps column

When we go to create a new action map, the system always generates a default action, we can delete it or modify it, I usually delete it because in the creation phase you are asked immediately what action you want to create, it is also possible to modify it from the third column that of the properties.

With this tool, we can go to create different types of input, from simple buttons that correspond to the keyboard command to more complex sets that use Vector2 to define 4 types of input related to a single action. We can also create key combinations and much more but to expand on this topic I suggest you look at the official documentation.

Essential is to remember to save the changes we are making, I personally prefer to keep disabled the auto-save function and save the changes manually.

Now that we have created our actions it is time to link them to our player in-game. We will deepen this part in the next article.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrea Alicino

Andrea Alicino

Unity developer and C# programmer. Currently looking for games industry employment.