Reader small image

You're reading from  Blueprints Visual Scripting for Unreal Engine 5 - Third Edition

Product typeBook
Published inMay 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781801811583
Edition3rd Edition
Languages
Tools
Right arrow
Authors (2):
Marcos Romero
Marcos Romero
author image
Marcos Romero

Marcos Romero is the author of the Romero Blueprints blog, which is one of the main references on the internet to learn about Blueprints. Epic Games invited Marcos to the Unreal Engine 4 closed beta program to experiment and collaborate with the evolution of the tools. He was also one of the first recipients of Unreal Dev Grants for Education. Marcos is a well-known figure in the Unreal community and, for Epic Games, he wrote the official Blueprints Compendium and Blueprints Instructor's Guide.
Read more about Marcos Romero

Brenden Sewell
Brenden Sewell
author image
Brenden Sewell

Brenden Sewell is a game designer and creative director with over a decade of experience leading teams in the development of compelling interactive experiences that entertain and inspire. Prior to joining Bossfight Entertainment to work on some upcoming secret projects, he explored the intersection of social impact and entertainment serving as the Creative Director for E-line Media. He has led developments from concept to live support on a variety of games ranging from a brain-training first-person shooter to a construction sandbox exploring the future of digital fabrication.
Read more about Brenden Sewell

View More author details
Right arrow

Tracking the ammo and targets eliminated

To get our UI to respond to the player interacting with the environment, we need to modify the player and target Blueprints. Let's start with the ammo counter to decrease when the player fires a shot from their gun.

Reducing the ammo counter

We need to modify the player fire logic so that the ammo counter is decreased when the player fires their gun. Follow these steps:

  1. In the Content Browser, access the /Content/FirstPersonBP/Blueprints folder and double-click on the FirstPersonCharacter Blueprint.
  2. Find the large series of Blueprint nodes contained within the Spawn projectile comment block. 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:

Figure 7.35 – Decreasing Player Current Ammo

  1. Find the final node in the chain, Play Sound at Location...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition
Published in: May 2022Publisher: PacktISBN-13: 9781801811583

Authors (2)

author image
Marcos Romero

Marcos Romero is the author of the Romero Blueprints blog, which is one of the main references on the internet to learn about Blueprints. Epic Games invited Marcos to the Unreal Engine 4 closed beta program to experiment and collaborate with the evolution of the tools. He was also one of the first recipients of Unreal Dev Grants for Education. Marcos is a well-known figure in the Unreal community and, for Epic Games, he wrote the official Blueprints Compendium and Blueprints Instructor's Guide.
Read more about Marcos Romero

author image
Brenden Sewell

Brenden Sewell is a game designer and creative director with over a decade of experience leading teams in the development of compelling interactive experiences that entertain and inspire. Prior to joining Bossfight Entertainment to work on some upcoming secret projects, he explored the intersection of social impact and entertainment serving as the Creative Director for E-line Media. He has led developments from concept to live support on a variety of games ranging from a brain-training first-person shooter to a construction sandbox exploring the future of digital fabrication.
Read more about Brenden Sewell