Book Image

Unreal Engine 4 Game Development Quick Start Guide

By : Rachel Cordone
Book Image

Unreal Engine 4 Game Development Quick Start Guide

By: Rachel Cordone

Overview of this book

Unreal Engine is a popular game engine used by developers for building high-end 2D and 3D games. This book is a practical guide designed to help you get started with Unreal Engine 4 and confidently develop interactive games. You’ll begin with a quick introduction to the Unreal Engine 4 (UE4) ecosystem. Next, you’ll learn how to create Blueprints and C++ code to define your game's functionality. As you progress, you’ll cover the core systems of UE4 such as Unreal Motion Graphics (UMG), Animation Blueprints, and behaviour trees to further build on your game development knowledge. The concluding chapters will then help you learn how to use replication to create multiplayer games. By the end of this book, you will be well-versed with UE4 and have developed the skills you need to use the framework for developing and deploying robust and intuitive games.
Table of Contents (10 chapters)

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