A developer wants to display the player's current health on a Progress Bar in the HUD. The health is a float variable in the 'PlayerCharacter' Blueprint that changes frequently. What is the most efficient method to make the Progress Bar's value update automatically?
-
A
In the Widget's Event Tick, get the Player Character, get the health, and set the Progress Bar's percent.
-
B
In the Player Character, create a reference to the HUD widget and call a custom event on it every time health changes.
-
C
Create an Event Dispatcher in the Player Character that is called on health changes, and bind an event in the widget to it.
-
D
Use a Property Binding on the Progress Bar's 'Percent' property to a function that gets and calculates the Player Character's health percentage.