Download

Widget BP: Multiple Health bars

Hello everyone.
I have 4 characters in my level, each of them are sharing the same blueprint.
They have a Healthbar above their head wich represents the variable “Health”.

When i shoot’em they have their own Health (100 Health Points) (i shoot the first then the second one etc… everything seems normal)

But the healthbar seems acting like it is common…
When i shoot the character 1 the healthbar of the others is following the same result…
It’s wierd because, the value of the variable “Health” for the others is still at their maximum value…

Here is a link to the video:

Here is the Blueprint:


If anyone knows a solution to make EACH character have his OWN healthbar… please let me know.
Thanks <3

Hey,
the loop will always stop execution at the first index, because it has a return node.
Give the health widget a reference to the enemy that has created the widget and than use this reference to get the health value.

I would also not use GetAllActorsOfClass function as this can lead to performance problems (every enemy has a widget and every widget goes through all enemies, the operation count in this case is (number of enemies)[SUP]2[/SUP] per frame).