0 votes

I want to do something like this:

tool

func _ready():
    var node = preload("....").inctance()
    add_child(node)

But this code adds a node to root/EditorNode. So when I start the application, I do not see the node on the stage.

Is it possible to implement this feature?

So that you can create nods through edits automatically, and add them to the scene?

in Engine by (54 points)
reshown by

I believe you want something similar to this other question: https://godotengine.org/qa/15486/create-nodes-in-the-editor-from-script

1 Answer

+1 vote

I think you need to set the owner of the instance for it to show:

https://www.youtube.com/watch?v=XPs-HGzElTg

by (1,888 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.