I found this question on how to make a structure: How do I implement structures in GDScript?
I tried using the suggestions to make a nested structure, but couldn't figure out how.
The following dictionary way doesn't work:
# doesn't work
var stuct = {
foo = 1
nested = {
bar = 2
}
}
Nor does the following class way:
# doesn't work
class struct:
static var foo: Number
class inner:
static var bar: Number
If I don't define the type of foo
in the class way, then I can get it to work. But I would like to have all my types set up. I also do not have values for all variables in my real world case, some need to be set by external operations.