Check for empty tree?

Godot Version

Godot 4.3.Stable

Question

Out of curiosity, is it possible to have a script check to see if the tree that it's in is empty?

Use “get_child_count()” and check if it is 0 should work, maybe?

1 Like

I personally use:

is_inside_tree()

Ryn

According to Node — Godot Engine (stable) documentation in English

This checks if it is inside a tree… So has a parent? Does it really check if the current node has no children? If yes, I find the docs kinda confusing :sweat_smile:

I only use it for checking if inside a tree, don’t have a need to check for children.