I have this
extends Node2D
var tscn
func _ready():
tscn = load("res://Node2D.tscn")
var array1 = []
array1.append(tscn)
var array2 = []
var temp = array1[0].instance()
add_child(temp)
array2.append(temp)
print(get_children())
array2[0].queue_free()
print(get_children())
I am going to have a bunch of tscn's loaded into an array in another project, and I would like to instance them from the array, and free them from the array. It basically helps for the organisation of the project.
The issue is, the above code gives me a stack overflow on line
var temp = array1[0].instance()
What is it I'm doing wrong?