Create Input Action #
Create the Input Actions required for your interactions (movement, camera, character Action like jump, fire, etc). Select the value type accordingly. Bool for button, Axis2D for joystick and touch region.
Create Input Action Mapping #
Add all created input actions to Input Mapping Context and assign gamepad or mouse/keyboard key. I recommend using gamepad key.
Touch Interface #
Create the virtual input required for your interactions (movement, camera, character Action like jump, fire, etc). Fill the accordingly input action.
Character C++ #
Begin Play #
In Begin play function, add mapping context. You need to create a UInputMappingContext* variable and expose it to Blueprint.
Setup Player Input Component #
Bind Actions to appropriate function in setup player input component
Functions #
In HandleMove function for example, get the action value and do something with it!
- ActionValue.Get<FVector2D> for Axis2D
- ActionValue.Get<bool> for Bool