Builtin Library
README.md
scene.tree
Render the entity hierarchy as an indented tree — the quick "what is the current structure" view.
Takes an optional target and an options table. With no target it renders the
whole active world, 4 levels deep; a target such as player renders just that
subtree; depth of 2 shows the roots and their direct children.
Each line shows the entity's name and its component types; children nest
under their parent. Anything deeper than depth (or beyond the node
budget) is summarized as an explicit … +N below count instead of being
silently dropped.
Options:
depth(4) — levels to expand; 1 is just the roots.components(true) — annotate each entity with its component types.includeInternal(false) — include entities marked internal, and their subtrees.limit(500) — the node budget.
Returns:
{
text = string, -- the rendered tree (print this)
roots = { { id, name, components?, childCount, children?, omitted? } },
total = number, -- entities in scope (full subtrees)
shown = number, -- nodes rendered
truncated = boolean, -- depth or budget cut something
}
The target is an entity id, a name (every matching entity), a proxy, or an array of them; omit it for the whole world from its roots. Children sort by name, so repeated calls give stable output.