Can't export array from global autoload python script
Hi, TouilleMan, I'm trying to use Godot's Array class from python. I have a global.py script (excerpt):
@exposed
class Global(Node):
key_signal = signal()
test = export(str)
velocities = export(Array)
def _ready(self):
self.test = 'ttttt'
self.velocities = []
The self.velocities array is working properly WITHIN global.py, but when I try to access it from another GDscript the error message is issued: "Invalid get index 'velocities' (on base: 'Node (global.py)'). Accessing 'Global.test' variable from other GDscripts is working fine.
If I change velocities = export(Array) to velocities = export(array) instead the whole engine crashes. Please point me in the right direction to access 'velocities[]' variable from other GDscripts. Thank you!
It is working now by changing the last line in the above code snippet to:
self.velocities = Array()
instead of:
self.velocities = []
Thanks!