Health Bar of Breakable Items

Dear Community,

I am trying to implement a Widget for my HUD.

When the Player is looking at (linetrace) a breakable object (actor), an icon should appear to indicate that its breakable. That part is completed.

It should also display the target actor’s Health in a progress bar. (GOAL)

The Widget is created in the PC blueprint, and the hide and appear function is also in the player BP.

I wanted to bind the health of the actor viewed to the percentage of the progress bar .

Attached an example from an old classic.

The actor is already set up with a health variable. The actor has it’s own class interface (destructable). The icon appears when linetrace hits a destructable actor from a short distance. Can it be managed to grab the linetraced actor’s health variable for the hud?

Do I have to bind it? (I tried binding the Percentage of the progress bar to the actors themselves, but no matter what i tried, it always displayed the first actor’s values only.)

How can I go about this? Thank you in advance.

Nevermind.

It’s solved. Forgot to use Interfaces.

Tick event fires line trace which Targets Destructibles Interface Message

Destructible event in actor firest a process which updates a Float Variable in the player Blueprint with the actor health, which is then bound to the percentage in the widget.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.