Unable to update HP for child Actors

Hi, I created a parent class actor and bound an HP control to it, then created 2 of its subclasses, but when I apply damage to a child class actor, I can’t update the health bar, what am I doing wrong?




Why are we using Get Actor of Class? This nodes gets the first actor it can find, not the one you think it does. You’re doing the whole thing to one actor only and we don’t even know which one… And the actor the damage is applied to may as well get somebody else’s widget… The absolute best case scenario is that you’ll get super inconsistent results.

Each actor has its own health bar - use that health bar. Is it a widget component?


  • Get Actor of Class is only useful if there is a single instance of something in the world.
  • Get All Actors of Class is only useful when you absolutely must get all instances and you never tracked them in the first place.
1 Like

Yes, widgets, child actors inherit the wiget of the parent class, please don’t mind getting all the actors, I was lazy and didn’t do attack detection, no matter which actor I choose to apply damage, it either doesn’t work, or only one ACtor can update HP


But this is why it does not work and never will…


  • parent class + 3 children:

  • the widget:

image

There is no binding in the widget. All is event driven.

  • base class:

  • we deal damage to all:

That’s what we’re after, right?:

1 Like

Thank you for your reply, your blueprint is new knowledge for me and I will study it carefully

1 Like

Thank you very much for your help, I understand what you said about get actor of class, it can’t be passed to every subclass actor