Topic was automatically imported from the old Question2Answer platform.
Asked By
Bodyak
I know about PackedScene and that we get it using load()/preload()and it works. However, I don’t like to have to provide a path to the file of a scene because I may want to move it at some point. So I tried adding a class_name and wrote add_child(ClassName.new()) but only the top-level node appeared in the tree. No children.
Question is, how do I properly instance a scene without using a path to it?
Another option is to add the scene to your Autoloads… in project settings… when you want to duplicate it you call yourScene.duplicate( ) instead of instancing it