Book Image

Blueprints Visual Scripting for Unreal Engine

By : Brenden Sewell
Book Image

Blueprints Visual Scripting for Unreal Engine

By: Brenden Sewell

Overview of this book

Blueprints Visual Scripting for Unreal Engine is a step-by-step approach to building a fully functional game, one system at a time. Starting with a basic First Person Shooter template, each chapter will extend the prototype to create an increasingly complex and robust game experience. You will progress from creating basic shooting mechanics to gradually more complex systems that will generate user interface elements and intelligent enemy behavior. Focusing on universally applicable skills, the expertise you will develop in utilizing Blueprints can translate to other types of genres. By the time you finish the book, you will have a fully functional First Person Shooter game and the skills necessary to expand on the game to develop an entertaining, memorable experience for your players. From making customizations to player movement to creating new AI and game mechanics from scratch, you will discover everything you need to know to get started with game development using Blueprints and Unreal Engine 4.
Table of Contents (15 chapters)
Blueprints Visual Scripting for Unreal Engine
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Tracking the ammo and eliminated targets


To get our UI to respond to the player interacting with the environment, we will need to modify the Blueprint scripting that controls the player and targets. To begin, let's get the ammo counter to decrease when the player fires a shot from their gun.

Reducing the ammo counter

The Blueprints managing the firing of the player's gun are contained within the FirstPersonCharacter Blueprint. Find this Blueprint within the Blueprints folder of Content Browser and open it. Now find the large series of Blueprint nodes contained within the comment block Spawn projectile. We want to ensure that the counter tracking the player's current ammo count reduces by one, each time the player fires a shot. The Blueprint scripting required to do so looks like this:

Find the final node in the chain, Play Sound at Location. Drag a wire from the output execution pin of this node to empty grid space, and add a Set Player Current Ammo node. Then drag a wire from the Player Current...