How to create multiple child widgets in a parent widget panel based off of an array resize?

I, literally, spent the entire day trying to produce this for my own inventory system to no avail. :face_holding_back_tears:

This is my approach,

I’m a huge fan of the ‘resize’ node, it’s just convenient to modify the value of the index without having to manually add elements. So, I wanted the value of the resize to reflect the number of child widgets added in a wrap box of another widget.

So, what I did is;

In the Wrap Box blueprint, I got a reference of the component (Attached to player character) which handles the array resize and its elements. Then I added a ‘for each loop’. I got the elements and connected it to the inputs, that I included, of ‘create widget’ (The slot) which is followed by ‘add child to wrap box’.

In the child widget, I didn’t add anything except for reflecting the texts of the Name variables of the array elements to the Text Box.

Having done that, only one child widget appears in the wrap box in the viewport. Good thing is that the texts in the elements actually reflect on the slot.

But I was really hoping the resize value of the array would also reflect on the number of child widgets to appear in the wrap box. I really thought this was how it was done…

I am a total wreck… I’ve modified my blueprints tons of times and had no good outcome whatsoever. I have no clue what I overlooked, so if anyone here understands how to get this to work, please, I’d be very grateful! :pray:

1 Like