Activity 4.01 – adding walking logic to our character
In the current game, our character runs by default when we use the movement keys, but we need to reduce the character’s speed and make it walk.
So, in this activity, we’ll be adding logic that will make our character walk when we move it while holding the Shift key on the keyboard or the Gamepad Face Button Right key (B for the Xbox controller and O for the PlayStation controller).
To do this, follow these steps:
- Duplicate the IA_Jump Input Action and name the new asset
IA_Walk
. Because this new Input Action’s setup is similar to that of the IA_Jump Input Action, we’ll leave this duplicated asset as is. - Then, open the IA_Character Input Context and add a new mapping for the IA_Walk Input Action. Add the following keys to this new mapping – Left Shift, and Gamepad Face Button Right.
- Open the
MyThirdPersonChar
class’s header file and add aclass UInputAction* IA_Walk...