I’m not sure what your data structure is supposed to be - it looks like some kind of dictionary - array hybrid. Dictionaries need unique keys to work, and your dictionary doesn’t have any keys in the outer dictionary. Either do something like this:
Also, the term is “iterate” and not “illiterate”. To get the dictionary, do this:
var dictionary = {}
for child in node.get_children():
var arr = []
for grandchild in child.get_children():
arr.append(grandchild)
dictionary[child.name] = arr
To get the array, do this:
var array = []
for child in node.get_children():
var arr = []
for grandchild in child.get_children():
arr.append(grandchild)
array.append(arr)
Holy fuck it works!! Thanks ! My initial problem is that the value replaces over and over because of iteration but boy it’s because I do avar arr = [] inside
the for grandchild in child.get_children() . Thank you very much