Passing multiple arguments to a new thread

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vonflyhighace2
:warning: Old Version Published before Godot 3 was released.

Is it possible to pass multiple arguments to a new thread? Example

workerThread.start(self, "Method", (Arg1, Arg2))

the method I am trying to put to work takes two arguments.

:bust_in_silhouette: Reply From: Zylann

Python tuples don’t exist in GDscript, instead you can send an array, like this:
workerThread.start(self, "Method", [Arg1, Arg2])

Your method has to accept an array instead of multiple parameters for this to work.

That’s a shame. guess this is were being a dynamic language saves GD script.

vonflyhighace2 | 2016-09-01 20:45