Make Tree node entries Start Collapsed

Godot Version

4.4.Stable

Question

Hello!
I’ve recently been exploring the tree node and have it functioning with the data I want. Now, I am considering how users might interact with the UI and have realized that anytime the tree is accessed after scene reload the user may have to collapse three or four sections before getting to the information they are looking for.

Is there a way to have some or all sections of a tree be collapsed when (or soon after) they are instantiated?

Thank you.

You can collapse a TreeItem by setting TreeItem.collapsed to true.

Ah, thank you. I knew Godot was too good to have overlooked something like that.
Note to future readers:
TreeItem (the visual elements added to the tree) and Tree (the node object) have separate documentation pages.

[Tree]
[TreeItem]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.