Connecting UI values to player variables
To allow our UI elements to pull data from our player variables, we will need to revisit the HUD widget Blueprint. Navigate to the FirstPersonExampleMap tab, go to the Content Browser panel, and open the HUD widget Blueprint in the UI
folder.
Creating bindings for health and stamina
In order to get our UI to update with the player stats, we will be creating a binding. Bindings give the ability to tie functions or properties of a Blueprint to a widget. Whenever the property or function is updated, that change is reflected in the widget automatically. So, instead of manually updating both the player health stat and our widget every time the player takes damage (so that the health meter display changes), we can tie the meter to a player value—health. Then only one value needs to be updated.
In the HUD Blueprint editor, find the Hierarchy panel and click on the Health Bar object nested underneath the Player Stats Bars object. With the Health Bar...