Widget Component - Get parent actor?

No, afaik the widget does not know it’s sitting pretty inside a component.


As a rule of thumb perform any calculations outside of the widget and then push ready data into the widget. You can do it in the actor that owns the widget component and access the component’s 2d widget.

Actor → Get Widget Component → Get User Widget → Cast → Call a Custom Event or Set the fields directly.

If you’re going to update it often (every frame?), consider creating a direct reference to the embedded widget on Begin Play.

This approach has multiple significant advantages:

  • you no longer rely on the widget ticking (offscreen widgets do not tick)
  • you do not risk an accidentally orphaned widget trying to access a null parent
  • it’s much easier to access an actor that has calculated data than pull that data out of a field of a widget embedded in a component…
  • it makes it super easy to set up Event Dispatchers in case the widget needs to send data back to the actor owning the component
3 Likes