Dying pt 2
Today we’ll talk about how to use the progress bar in your widget Blueprint.
One way to do this would be to have three different parts:
- The energy variable stored in your player character. (You could also store it in the Game Instance if you want the health to be the same on a new level).
- An actor blueprint enemy that, when overlapped, casts to the player character and deducts, say 0.1 from the health float variable of 1. This blueprint could to other things to your player character such as temporarily change their material to be red or make them jump back.
- The widget blueprint with the progress bar. The progress bar will have a bind function that casts to the player character to read the health variable.
See if you can do this on your own! I will go through it toward the end of class and do a recording.