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
Unreal Engine 4 Game Development Essentials

You're reading from   Unreal Engine 4 Game Development Essentials Master the basics of Unreal Engine 4 to build stunning video games

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781784391966
Length 266 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Satheesh P.V Satheesh P.V
Author Profile Icon Satheesh P.V
Satheesh P.V
Satheesh PV Satheesh PV
Author Profile Icon Satheesh PV
Satheesh PV
Arrow right icon
View More author details
Toc

Setting up a project


To get started, start Unreal Engine 4 and create a new project based on Third Person Template.

Since we are going to have a HUD with a health bar, let's add a new health variable to our Third Person Character Blueprint. Open up the ThirdPersonCharacter Blueprint in the ThirdPersonBP/Blueprints folder:

Inside our character Blueprint, create a new variable called Health and follow these steps:

  • Set the variable type to float and give it a default value of 100. The next step is to create a Pure function that shows the percentage of the total health of the player.

  • Inside your Character Blueprint, create a new function (for example, GetHealthPercentage) and open it.

  • In the function graph, get your health variable and divide it by the default value of health. By doing so, we will get the percentage of our player health. To get the default value of any variable in your class, just right-click in graph and search for Get Class Defaults. This node will return all the default values...

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