Unity New Input System — Overview
Unity is transitioning into new input system that utilizes a built in GUI for much of the action mapping as opposed to the legacy process of manually mapping in C#.
While this system will eventually become default setting and will ship with Unity, for now it must be downloaded from the package manager and implemented manually.
This package allows you to create input maps using a new window that can be referenced and swapped in code. The main benefit of this system versus the legacy is that you can quickly create several different control schemes and change them in-game with ease. In games that feature character swapping, vehicles, or even move-set changes for different weapons can benefit from isolating these various input presets to avoid overlap and potential issues.
You can create a new action map the same way you create a script or asset in the Project window.
Double clicking on this new action map will open the editor window for action maps
I will cover this in debt as we explore each piece, but here’s a simple overview of the system.
The action maps tab holds all of your various control schemes. For a game like Grand Theft Auto you would likely have a “Player”, “Car”, “Boat” and “Plane” action map. This are complete control schemes that can be swapped between.
In the center column is the Actions tab. This column will hold unique information for each of the action maps you create. Walking, running, jumping, attack, blocking, etc.
The final tab shows any and all modifier on the currently selected action. This allows you to set parameters for when the action should occur (like holding down a button to charge up an attack, etc).
Tomorrow we will take a look at creating a simple walking action map!