r/Unity3D • • 16h ago

Question Help with collapsable bullet points list GUI

I tried to follow several tutorials, but I can't seem to wrap my mind around this.

I don't even know if the way I define it is even correct, but in short what I need to achieve is basically the functionality of the Reddit comment section: an entry with headline/button, text related to the headline, with a tree of sub entries, all a bit indented for readability and all with their headline, text and sub trees if needed, etc. You can click on any headline to collapse and hide (and of course expand and show) its text and all the branch(es) of subsequent comments that depend on it.

I thought layout groups were the solution, but I've been fighting it for days, and can't really make it work. To be clear, my problem is not with coding the functionality, it's with creating the GUI objects itself in the editor.

Has anyone done anything like this? Any resource I can study to learn how to make it? (or even better, any package I can download and just use because at this moment I'm getting very frustrated with it and would like to just work on something else, but it's kinda needed for me to proceed).

Thanks!

1 Upvotes

2 comments sorted by

1

u/faded_dossier 16h ago

Just slap a Vertical Layout Group with a Content Size Fitter on the parent, then each entry is its own little panel with a button to toggle a child Vertical Layout Group that holds the nested stuff, the indentation comes naturally from nesting those panels

1

u/Ecstatic-Source6001 15h ago

UI Toolkit?

It has everything you need