Getting variables set in UMG widget, in an other blueprint

I’m trying to read variables that were set through the UI in a UMG widget, in a separate blueprint I have placed in my level.

So as an example:
I have a UMG widget in the viewport, in which the user enters a text value in an editable text box.
It is then set as a text variable like this:


I click the icon to make this variable editable.

I have another blueprint, placed in my level. I add the widget as a variable and make it editable.
I then set this up to see if I can compare the text value the user entered in the UI, with a predefined value. “BenchmarkingAssessor_EVal”.

Pressing C to compare the two does nothing, if I remove the IsValid node, then the editor crashes. Pressing V to set its value (of the variable in the widget) results in an error message:

Error Accessed None 'Assessment_Form_Object' from node Add StaticMesh Astra_Car_Paint001 in blueprint Astra_A

Error Attempt to assign variable through None from node Add StaticMesh Astra_Car_Paint001 in blueprint Astra_A

The add static mesh is a node in the construction script.

Obviously I am not doing this right. I have a huge amount of variables I have to read from the widget in this way, how should I be doing it?

Hey Mosel3y,

Whenever you want an Object, you must spawn it. The way to create UMG Objects is with Create Widget, from there you can store it in your variable you have within the Blueprint. So just add it to construction and it will be there on spawn. As for the UMG Widget, I would suggest having an event on the Blueprint within the Level. Once the Widget has received the players input, instead of setting it locally, it sends it through the event to be stored on the Level Blueprint Actor. When you create the UMG object, cast it and set a local variable containing the Parent Blueprint.

Let me know if I need to clarify!


I completely forgot I would need to do it that way - I was creating the widget in the level Blueprint.
What you said makes a lot more sense; it’s working now. Thanks for the help!

im stuck in a blueprint.
i have a class blueprint say “chair” in my level and i want to send a variable to umg i tried binding in umg but after i exit play mode i come up with error accessed none from “chair”. i have already tried making a variable for storing the refrence of chair in umg. pls help me