Customizing controls
You may not like the default controls and key combinations associated with the input axes—Horizontal, Vertical, and Fire1. Perhaps you want to change them. Even if you don't want to change the controls for this game, you most certainly will in a future project, so it's good to know how.
The input axes are read using the Input.GetAxis
function (shown earlier) and are specified by human-readable names, but it's not immediately clear how Unity maps specific input buttons and devices to these virtual axes. Here, we'll see how to customize them. To get started, do the following:
- Access the input settings by navigating to Edit | Project Settings from the Application menu.
- Select Input Manager in the Project Settings window that opens.
On selecting this option, a collection of custom-defined input axes appears as a list. This defines all the axes used by the input system. The Horizontal and Vertical axes should be listed...