`Hello everyone, I am currently searching for a way to put spawn thousands of object in the build menu before debugging, but I cant just put them in by hand, and as such I want to know if there is a way in godot to spawn in many objects just like in debugging with “addchild()” or “addsibling()” but instead it is put in this menu permanently
This is the process:
Add this code to the script of the highest node in the scene:
func _ready():
var scene = PackedScene.new()
var parent = $"."
var instance = $"path/to/node"
for i in range(100): #number of instances
parent.add_child(instance.instance())
scene.pack(parent)
ResourceSaver.save(scene, "res://NewScene.tscn")
Run the scene, a NewScene file will be created in the project directory that has 100 new instances.