I’ve got a widget blueprint which is used as a widget component inside an actor, which is meant to display it’s health with a progress bar. How can I get a pointer/reference to the actor which’s component this blueprint actually is (picture)?
I’ve only found a way to get player’s pawn, which I don’t want here, as the health bar appears above npcs too.
GetOwner does not work on Widgets. You will either need to pass in a reference to the parent actor through some kind of initialise function with the widget, or have the actor itself call other functions on the widget itself.
Then I have misunderstood your question. I thought you wanted somehow to get the owning actor of the widget component, but it looks like you are trying to do something different. Can you explain again what your are trying to achieve and what your problem is.
The idea is for many different widget blueprints (used as widget components) to get the pawn they are components for, and use some data from it to update itself.
I don’t really want the pawn to set the data in widget with some functions, becouse I would have to create many blueprints of the same actor, just to handle widgets with different logics.