You are on page 1of 8

Input Manager

 The Input Manager window allows you to define input axes and their associated

actions for your Project. To access it, from Unity’s main menu, go to Edit >

Project Settings, then select the Input category.

 The Input Manager

 uses the following types of controls:

 Key refers to any key on a physical keyboard, such as W, Shift, or the space bar.

18-07-2020
 Button refers to any button on a physical controller (for example, gamepads),
such as the X button on an Xbox One
 controller.

 A virtual axis (plural: axes) is mapped to a control, such as a button or a key.


When the user activates the control, the axis receives a value in the range of [–
1..1]. You can use this value in your scripts
.
18-07-2020
Virtual axes

 Every Project you create has a number of input axes created by default. These
axes enable you to use keyboard, mouse, and joystick input in your Project
straight away.

 To see more about these axes, open the Input Manager window, and click the
arrow next to any axis name to expand its properties.

18-07-2020
18-07-2020
Adding, removing, and copying virtual axes

 To add a virtual axis, increase the number in the Size field. This creates a new axis at the

bottom of the list. The new axis copies the properties of the previous axis in the list.

 To remove a virtual axis, you can either:

 Decrease the number in the Size field. This removes the last axis in the list.

 Right-click any axis, and select Delete Array Element.

Note: You can’t undo this action.

 To copy a virtual axis, right-click it and select Duplicate Array Element.

18-07-2020
Mapping virtual axes to controls

 To map a key or button to an axis, enter its name in the Positive Button or Negative


Button property in the Input Manager.

18-07-2020
18-07-2020
Using virtual axes in scripts

 To access virtual axes from scripts, you can use the axis name.

 float horizontalInput = Input.GetAxis ("Horizontal");

18-07-2020

You might also like