Language:
Page Info
Skill Level:
Engine Version:

2. Input and the Game Mode

Here we will set up the Input (Game Controls) to control the character and create a Game Mode which will use our character.

  1. Right-click in the Content Browser and create a new Blueprint Class of the Game Mode class and name it MyGame.

  2. Open the MyGame Blueprint, then click the Class Defaults button from the toolbar.

    SelectClassDefaults.png

  3. In the Details panel under Classes, set the Default Pawn Class to use the MyCharacter Blueprint.

    GameMode_1.png

  4. Compile and Save then close the Blueprint.

  5. From the Main Editor Window, click Edit from the Menu Bar and select Project Settings.

  6. In Project Settings, click Input under the Engine section.

  7. Under Bindings, add four Action Mappings and four Axis Mappings.

  8. For the first two Axis Mappings, click the plus sign next to each one to add an additional mapping to the group.

    Input_1.png

    Your empty Bindings should look like above.

  9. Set up your Bindings similar to below (make sure to set the Scale for A, S, and Mouse Y to -1.0).

    Input_2.png

    Here we set inputs for Jump, Crouch, Jog, and Prone for the Action Mappings and MoveForward, MoveRight, Turn, and LookUp for the Axis Mappings. You can set these as shown or select your own inputs for each.

    For more details on this process, see How to Set Up Inputs in Blueprints for more information.

  10. Click the Maps & Modes option under the Project section of Project Settings.

  11. In Maps & Modes under Default Modes, set the Default GameMode to use the MyGame Game Mode.

    GameMode_2.png

    For more details on Game Modes, see Setting Up a Game Mode for more information.

  12. After setting both the Input and Game Mode settings, close the Project Settings Window.