Why do these 2 widgets display the same variable on different actors?

As you can see both of these enemies have a health bar that displays a Health Variable.

But I haven’t damaged the one in the distance but they still display the same health variable.

Despite it displaying both of them having the same health variable the value itself is different its just the widget displaying it isn’t displaying each actors separate health value.

Any help is appreciated, thanks!

Can you show / describe what creates the widgets and how the progress bar value is set?

Also, spooky.

The widget is created in blueprints

Get All Actors Of Class returns same set of actors and you always getting one with index 0, which is the same actor. Insted of using Get All Actors Of Class, send health to the heal bar components directly to set value of the bar from the actor

How would i do that 'Directly"?

Yea, you are currently only grabbing the actor with the index 0.
You’d need to get all actors of class and let a ForEachLoop do the rest.
(although I would rather let the actor do the work, instead of the widget)

Assuming you are using the Widget Component Widget Components in Unreal Engine | Unreal Engine 5.1 Documentation

Inside of the blueprint as is suggesting you can use this Cast to parent actor of widget? - UI - Epic Developer Community Forums method to access your specific widget and set the percent bar value on the Event Tick. You could probably do the cast on Event Begin Play and store your user widget object to avoid casting it on each tick.

Those widgets are on component right? so put code in actor that sets health bar, as you can access it via component

Ok thanks everybody for their help

This made the UI start working the way i want it to

I made a variable that gets the Blueprint for the character then sets the progress bar to the health /500 (because his default health is 500)