Set text variable in widget from another blueprint

Hello,

I have a WidgetHUD called InfoBox which is shown when the user clicks on a specific object “MouseTest2” which has a variable called “TextTest”.

In InfoBox there is a Text Field “Field1”

I have the “MouseTest2” blueprint set to create the widget and add it to the viewport which works well. What I can’t figure out is how to update “Field1” in the widget to the string variable “TextTest” that is in “MouseTest2”

I have messed around with “Set Field1” but I just get an error “String is not compatible with Text Reference”

I do have “Field1” set as a variable in the widget, I’m sure I’m just going about it the wrong way.

Did you create a binding? To your text in UMG?

No, I didn’t know that was needed, I made bindings but don’t know where to go from there

edit: I played around and added an input to the function. but when I link it to the return node I get an error, that it has the wrong number of arguments, it needs to return 1 value and take no parameters

I found the answer myself after more screwing around and going through the whole list of functions I found “Set Text (Text)” which did the trick

Thank you! Dear future self, when you Google this do the following:

Get the variable from the widget. Then Set (Text) the variable. You can’t just set the text on the widget.

67196-settext+of+widget.png

Thank you, you saved me no end of time and aggro…
Nice one you’re a star!

What did you connect the “Target” to?