Use blueprints in BP widget to add new components to the UI blueprint widget

How do I use blueprints to add elements to the Ui?

I have an integer variable which will change dynamically from 0 - 10 as the user goes up a level that integer will go from 0 to 1 then 2 and so on and I want to show new levels each time but the number of levels is going to be determined from a web server so I cannot just hide and show these levels as there may be 10 now but 20 in a few weeks and I am trying to avoid app upgrades as much as possible.

I also have a Vertical box in the blueprint widget which contains a group of various child components like Border > Horizontal Box > Canvas panel and so on.

I would like to know how I can use blueprints to add (or even better duplicate) that group then modify the new groups contents like change the text of 1 to 2 as the player goes up a level I want to show more levels on the menu.

The bits you want to duplicate should be a separate user widget. You can then add those user widgets as building blocks to the vertical box. Updating a widget field is as straightforward as:

get text block → set text

Ok that sounds good … so how to actually do that in blueprints? When I right click and search in the node list there is nothing that stands out to me. How do I add a bp widget into that specific location which is circled in red in the image (as a child of Vertical Box) using blueprints what is the node used?

If I had to guess I would think I need to make Horizontal Box a variable and then there would be a node somewhere called add child widget but no such thing exists so I guess that is not how it is done.

I have seen some talk of using named slots but how do they work with blueprints? Can I add multiple Widgets into the location of a named slot? And how does that work in blueprints I cannot see any way to do that .

  • create a widget that represents the chunk of UI that needs duplicating:

If there’s a text field you’d like to update, flag it as isVariable:

  • in the same widget, add a new Instance Editable variable that is Exposed on Spawn, and a Custom Event:

  • in the main widget (or anywhere else, really):

  • the result:

Hope it helps.

1 Like

Thank you so much @Everynone that got me going and I managed to figure out the other Ui things I was stuck on because of your info. Thank you. :partying_face:

1 Like