-
Book Overview & Buying
-
Table Of Contents
Mastering Unreal Engine 4.X
By :
While the input setting relies on the project setting, I always like to discuss it as an individual topic. If you have come from an engine structuring background, you probably know that the inputs are an independent topic just like rendering, networking, and so on.
Any game built within Unreal Engine (or any game in general) must have the input class, which defines the whole input for the game. Fortunately, Unreal Engine has made this step easier, and has given you the chance not to worry about input handling. It does this for you at a lower level of the engine core, and gives you a nice and easy-to-use interface, where you can map some predefined input keys, buttons, and axes, and name them. You can then refer to these buttons by code using their respective names.
Unreal Engine supports a lot of input devices, which has made the input mapping list huge, and it is better to learn more about the supported devices in order to make this huge list easy to manipulate. The inputs that are supported are:
And that's how the list of inputs looks by default while every section is folded; unfolding those sections will give you an endless list of keys and buttons that you can map for your game and for different platforms and devices.

In order to use these inputs for your game, you have to select some keys and give them names; this is called the process of Binding Keys. But before diving into this process, you will have to understand the different types of binding within Unreal Engine.
Unreal Engine supports two main binding types; they are divided by the sensitivity of the input key/button. This means that the input button/key could fire a couple of events when it is pressed and/or released, or it will keep firing events as long as it is pressed. The two main types of bindings are:
Here are few more points to remember before we start the mapping process:

Now you are ready to go. By opening the project settings from within the Edit menu, and then navigating to the Input options under the Engine section, you have access to the inputs mapping. You can now start mapping your key inputs.
The end result of this action key mapping should eventually look something like this:

The end result of this axis key mapping should eventually be something like this:

Now you have successfully mapped the game inputs. Keep in mind that you might need to map more keys in the future, but those are the keys I needed for Bellz. If you need more you can keep adding and mapping keys based on your game design. Personally I found those inputs are enough for our current example.
If you still remember the project directory we mentioned earlier in this chapter, there was a config folder for the project. If you access this config folder, and you open the DefaultInput.ini file using any text editor, you will find the input mapping that you've already done at the end of the DefaultInput.ini file. This means those inputs are modifiable at any time because the shipped game will have a similar file eventually!