So I have an actor blueprint in the world that is a building with ‘hit points’. The hit points are decreased as another character that moves around the level touches this building.
That all works great, and each individual building in the world will take individual damage as the damaging character moves around. But I have a health bar (a progress bar ui element) on top of the building, this health bar has the following ‘get percent’ function. To be specific, this health bar is a widget added in the building’s blueprint.
So, none of these work. In A, the cast fails as the object input is most likely wrong, in the example it’s set to be just a reference to “Actor”. How could I make this input reference a unique object in the level?
In B, it “works”, but it affects every building’s health bar, even though the values themselves do remain unique to each building. So basically when the damaging character touches the 2nd building, the health bar doesn’t decrease. It will only decrease when it damages the first building.
In C, I tried to get a copy from an array but it’s exactly the same result as B.
The ‘create widget’ function doesn’t allow me to place the widget inside the blueprint, so my question is it will put them in ‘player space’? And not sure exactly what to plug into ‘owning player’ as ‘get player pawn’ or ‘get player character’ don’t work there. I can extract the ‘get percent’ value from there, but otherwise I don’t know how to make this function.
The other option, ‘add widget component’ does allow me to physically see the widget added to the building when I play, but I am not able to extract the ‘get percent’ function from the node, basically it doesn’t open up the option to edit the widget itself. So I know I’m missing something here and if you know I’d appreciate the tip!