Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Aravash |
i create an unassigned var called thread.
var thread
in ready i set thread as below
thread = Thread.new()
in process i check if the thread is not active by doing
if not thread.is_active():
This works fine in one gdscript I am using, but doesn’t work in another?? I get the error as written in the title.
the two scripts are functionally identical when it comes to this point in threading, but only one seems to recognise thread as being a Thread at this point, while the other sees it as Nil
setting the unassigned var to this ‘fixes’ the issue,
var thread = Thread.new()
but later in the script I call
thread.wait_to_finish()
and I get this error:
wait_to_finish: Thread must exist to wait for its completion
The really confusing thing to me if it’s set up identically in a prior script and doesn’t give these errors at all. Any ideas?