Widget component

I have added a widget component to an actor, than I asigned custum widget class to it. In my widget class I have a text and I want it to display a value of a variable that I have in the actor to which I added that widget component. How can I do that?

I made it work although I don’t know why it works xD