UMG Creating Childs from Widget Blueprints

Hi,

at first I’d like to thank you guys at Epic for the effort you’ve put in UMG so far. I make good progress with our games’ UI, thanks to you. I’m looking forward to share the results with you in the near future.

I have a (little) feature request. I’d like to create childs from widget blueprints. We are going to implement split screen coop for our game and it would be great to create different versions of a widget, dependant of the number of players. I’d like to tweak the widgets without doubling the maintenance effort.

Best regards,
Sascha

I think this is what you’re trying to do. You can create an instance of one of your widget blueprints and add it to your current widget through the Canvas (there are other sub-widget types you can add it to, Canvas is just the default). Make sure your Canvas has the checkbox checked “Is Variable” so you can access it in the blueprint. After creating the widget and adding it to the Canvas, you just need to set it’s size and position (it doesn’t seem to use the widget’s default size). You can also do this at any time by calling “Slot as Canvas Slot” on a reference to the widget. Just remember to keep a reference to your child and when you’re done with it, you need to call RemoveChild on the parent. Official docs (very short) at the very bottom of this page: Creating Widgets | Unreal Engine Documentation

Hope this helps,

Shane