Adding Keyboard control to TopDown Game Mode
Table of Contents
1. Create the Input Action #
The first step is to create an Input Action for character movements. In the Content\TopDown\Input\Actions folder
create a new Input Action names IA_Move and set the Consume Input field to True, you also want to set
the Value Type to Axis2D (Vector2D)
2. Update Input Mapping Context (or create a new one) #
In order to ensure your character can move, you need to create or update the Input Mapping Context that comes with the mode. The default one should be located in Content\TopDown\Input.
Open the IMC_Default and add the following elements:
3. Update your Controller Blueprint #
The final step is to update your BP_TopDownController blueprint located in Content\TopDown\Blueprints
The easiest step to implement this is to use the EnhancedInputAction_IA_Move from third person starter content and update the targets of the AddMovementInput to be the Character blueprint you’re using (you can also recreate it entirely from the screenshot below)
And voila, easy peasy :)