Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
Blueprints Visual Scripting for Unreal engine

You're reading from   Blueprints Visual Scripting for Unreal engine Build professional 3D games with Unreal Engine 4's Visual Scripting system

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher Packt
ISBN-13 9781785286018
Length 188 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Brenden Sewell Brenden Sewell
Author Profile Icon Brenden Sewell
Brenden Sewell
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Creating collectable objects

Restricting the player from firing their gun when they run out of ammo forces the player to be considerate of the accuracy of the shots they attempt within the game. However, limiting ammo would be unduly punishing without a way of acquiring more. We don't want ammo to naturally recharge like our stamina meter. Instead, we'll create a collectable item to allow the player to regain ammo by exploring and traversing the level.

Setting up collection logic

To create a collectable item, we will first want to start a new Blueprint that will determine the properties of each instance of that object that appears in the world. To do so, navigate to the Content Browser of the editor and open the Blueprints folder. Add a new Blueprint class, choose the class type Actor, and name it AmmoPickup. Once the Blueprint is made, double click on AmmoPickup to open the Blueprint editor.

In the viewport window that appears, we will see a simple white sphere. This is the default...

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 $19.99/month. Cancel anytime