Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unreal Engine 4 Game Development Quick Start Guide

You're reading from   Unreal Engine 4 Game Development Quick Start Guide Programming professional 3D games with Unreal Engine 4

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789950687
Length 202 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Rachel Cordone Rachel Cordone
Author Profile Icon Rachel Cordone
Rachel Cordone
Arrow right icon
View More author details
Toc

Adding a weapon Equip control

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:

  1. In the main editor window, go to Edit | Project Settings.
  2. In the Engine section, click on the Input option.

  1. 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:

  1. Go to the ThirdPersonBP\Blueprints folder and open the ThirdPersonCharacter file.
  2. In the Event Graph, right-click and add our Equip InputAction.
  3. In the My Blueprint tab on the left, create a new Boolean variable and name it bWeaponEquipped...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime