We've done this before in Chapter 2, Programming Using Blueprints, when we added a Sprint control to our character, so this should be familiar. This time we're going to add an Equip control:
- In the main editor window, go to Edit | Project Settings.
- In the Engine section, click on the Input option.
- We need to add an Action Mapping. Click the + button next to Action Mappings. Name this new one Equip, and assign it the Mouse Wheel Axis key. This will fire when the mouse wheel is scrolled up or down.
The new Action Mapping should look like this:
Now we need to add some code to implement this event:
- Go to the ThirdPersonBP\Blueprints folder and open the ThirdPersonCharacter file.
- In the Event Graph, right-click and add our Equip InputAction.
- In the My Blueprint tab on the left, create a new Boolean variable and name it bWeaponEquipped...