Using Trees in Human UI Stacks

Hello,

I am trying to develop a UI that can have a large number of expanders with similar elements within. The number of expanders is controlled by a slider in another part of the UI. So far, my script looks like the image below, where everything is organized by a combination of horizontal and vertical stacks. I have to copy this group multiple times to get multiple expanders.


I thought there must be a way to do this with trees, and developed the following script. Unfortunately, the final result appears to hide all elements that go into the stacks, except for the final stack. If anyone could help me figure out the problem, that would be greatly appreciated.

The trees will work; duplicate will not. Human UI Controls cannot be duplicated — they are always references to the same, single control. Try duplicating before you create any elements instead, like so:

That worked perfectly! Thanks for the tip, this will save so much time.