Pass variables from one blueprint to another to print in UI

Hello,

I have a model of a building as a blueprint named: BP_BLD_house_4, inside the blueprint I have definded a few variables like Building_Rent, Building_Expenses, and Total_cost

I then have a second blueprint, Building_info_UI that when a building is clicked on opens up a canvas with a border and a close button

What I am trying to accomplish is to simply take the variables from BP_BLD_house_4 and pass them to Building_info_UI so when the UI is opened it shows the rent, expenses, and cost and i cannot manage to update the text box with the variables or get the variables into the second blueprint

Attached are some photos of my code. where you can see i tried to make a function called Set Building Data within Building_info_UI where it recieves the data and uses set text to change the variables

on the designer screen, ive already made sure that the text box has isvariable set to true but when i try to drag EstRentText into the SetBuildingData function as a set node, its greyed out and im not able to actually set or change the variables and i cannot figure out what im doing wrong. I am like 4 hours into chat gpt and 3 hours into youtube to no avail

any help would be greatly appreciated.

heres the greyed out set estrenttext


heres the configuration of the designer for the ui wit the textblock as a variable

heres the building blueprint with the variables and the ui click trigger

If you need variables from the blueprint to go into the UI then I would recommend for you to put the variables in a save container and access the container from both sources. An example would be create the save system and then put the variable in it, then when you need to adjust something via the blueprint, pull the variable from the save, change it, and save it. Depending on what you need the variable for then you can just have the on event being/init/create widget->add to viewport so you can promote the save system so it can be pulled from your UI.

  • drag a wire from the Create Widget node’s Return Value and call the widget’s event that sets text (there are other options here, like exposing variables and using Event Construct)

  • remember to connect the execution wires in the widget, they are currently disconnected

  • most importantly - you will need to tell the UI widget which text fields you mean, currently you’re using an incorrect node that targets Text Render Components instead of widget Text Blocks

    • ensure the text blocks are flagged as isVariable:

    • drag their reference variables into the graph and hook them all up:


@DragonRelt both of your suggestions are misleading, to say the least. The UI should not pull data, it’s not its job to look up things. And creating a save system for passing variables around… while creative, it has to be the most inefficient and performance / memory footprint unfriendly method there is.

1 Like