Child Node not showing in Scene Tree

I’m experiencing an issue where a Child Node is not showing up in the Scene Tree in Godot. The Child Node is created and added to the Scene Tree using the add_child() function, but it’s not visible in the Scene Tree. How to fix it



  1. It must be a tool script to run within the editor
  2. the node’s owner must be set to show in the Scene tree

Make sure to post in the Help category

1 Like
  1. C++ not exist tool
    I debug code run in editor

node->set_owner(get_tree()->get_current_scene());
node->set_owner(get_owner());
_node->set_owner(get_parent());
result as same, it not show in scene tree

You need to use EditorInterface::get_edited_scene_root

3 Likes

Thanks
node->set_owner(get_tree()->get_edited_scene_root())
ok, it work