@Tools not showing up in scene tree

Godot Version

4.3

I’m trying to use tools to populate a root node. The changes are showing in the 3D view but I don’t see any children in the node view.

I’ve saved scene, reloaded the editor, used things like node.owner = node.get_parent.owner, get_tree().edited_scene_root.notify_property_list_changed but nothing.

If I hide the root node all the stuff vanish from 3D scene so it’s like it’s in the root node but if I check the tscn in a text editor I don’t see any special nodes inside. Just the basic stuff.
Is there a problem with the editor?

You’ll need to set its Node.owner property pointing to the root node of the scene after you add_child() You need to do this for every Node you create and add.

1 Like

Thank you. I tried that already but you saying that made me look over my code. And I had it set to get_tree().edited_scene_root.owner instead of just edited_scene_root for some reason. Maybe that’s the problem with using AI to learn this engine. Hehe.

(Also I saw your Unity at home, nice).

On a side note is there a way to make the script just run it once? Only code in _process runs and not _ready.

I’m not sure I understand what you mean. _ready() will only run once when the node is ready and _process() will run every update tick.

If you are just automating the creation of some nodes in the opened scene you may want to use an EditorScript instead. More info here: Running code in the editor — Godot Engine (stable) documentation in English

1 Like