Handling player input will likely be among the first game systems you implement. Unity Technologies unveiled a new Input System in 2019 intended to replace their previous system. While the new Input System allows building on more idiomatic Unity patterns, it can also be more challenging for a newcomer to pick these up. This is especially true because the Input System leans on configurable assets and emphasizes Editor usage. The Input System’s Quick start guide is helpful, but only once the Input System and Unity Events’ basic concepts are understood.
Much of the newer pieces of the Unity Engine are being released as encapsulated packages. Unity packages are installed from the Unity Package Manager UI in the editor (open it in Window > Package Manager). The package updates a
manifest.json file that has a
"dependencies" entry identical to a
package manager resolves dependencies and writes to a
package-lock.json. You can install the Unity Input System from the Package manager, which adds a dependency on
com.unity.inputsystem in your manifest.
The Input System makes it easy to create player-configurable cross-platform game controls through assets known as Input Action Maps. The system also exposes an Editor- and event-based interface to specify Input behavior.
If you’d like to make progress on a proof of concept quickly, you might initially choose to sidestep Input Action maps and programmatically interrogate the inputs.
Here’s a basic example covering the most important concepts: