Coding a simple player controller with the new Input System
You’ll be surprised to find that most of the work to make our player character move has already been done for us by Unity’s features. The features that we’ll be looking at in this section are as follows:
- The new Input System: For receiving keyboard device input from the player.
- 2D physics engine: For translating input values into movement and providing interaction with objects in the environment.
New Input System
The new Input System is a package that provides input device support for controlling objects in your project in a flexible and configurable way. It also replaces the legacy Input Manager. We’ll first want to make sure that it’s installed to use it:
- Open the Package Manager from the File menu by going to Windows | Package Manager and following these steps.
- Make sure the Packages drop-down list is set to Package: Unity Registry (just under the window...