0 votes

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.

in Engine by (273 points)

1 Answer

+1 vote
Best answer

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.

by (29,088 points)
selected by

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.