Hey all, I'm having an issue that I'm hoping is just a misunderstanding of how to use something. I have a custom class, like so:
class TestClass:
var num = 0
func _init(numIn):
num = numIn
func update():
print("hello")
num += 1```
In a scene, I want to create multiple instances, and store them in an array:
var tests = [TestClass]
func _ready():
var new_test = Debug3d.TestClass.new(5)
tests.append(new_test)
var new_test2 = Debug3d.TestClass.new(5)
tests.append(new_test2)
Then update them later:
func _process(delta):
for test in tests:
test.update()```
This all works. However, when var tests = [TestClass] uses a typed array like I've written here, every call to update results in:
Can't call non-static function 'update' in script, despite calling it just fine. However, if I do var tests = [], it works just the same, except with no error.
Is there something about gdscript 2.0's typed arrays that I'm misunderstanding here?
FWIW, this is the windows 64 v4.0.stable.official [92bee43ad] build