Announcement

Collapse
No announcement yet.

Widget BP: Multiple Health bars

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:
    https://www.youtube.com/watch?v=GPCk...ature=youtu.be

    Here is the Blueprint:
    Click image for larger version

Name:	Get-all-actors.png
Views:	117
Size:	52.1 KB
ID:	1711923
    If anyone knows a solution to make EACH character have his OWN healthbar... please let me know.
    Thanks <3

    #2
    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)2 per frame).
    Products: Damage, Stat and Resource System, Inventory System Support/Contact: Discord/E-mail
    Documentation: Synware

    Comment

    Working...
    X