Input System
Explore how to implement and configure Unity’s old and new input systems to manage user controls effectively. Learn to set up input mappings, use the Input System package, and debug inputs to create responsive AR applications.
Introduction
In game development, user input is a fundamental aspect that allows players to interact with and control the game. Unity provides two input systems: the old Input System package and the new Input System package. In this lesson, we'll explore both input systems, their features, and how to use them in our Unity projects.
The old Input System package
The old Input System is the legacy input system in Unity. It has been widely used in previous versions and is still compatible with the latest Unity releases. This input system relies on the Input class and provides various methods to handle user input, such as GetKey, GetButton, and GetAxis. These methods allow us to detect keyboard, mouse, and controller inputs. The old Input System is straightforward and suitable for simple input requirements.
Using the old Input System in Unity
In this example, we’ll demonstrate how to use Unity’s old Input System to detect keyboard input for player movement in a 3D environment. We’ll create a scene where a player object moves horizontally using the arrow keys.
The step-by-step instructions
Scene setup: ...