Thread.Start() not calling function properly?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Aravash

Using GDScript
In Process:

if not thread.is_active():
	thread.start(self, "load_chunk",[thread, x, z])

load_chunk:

func load_chunk(arr):

I’m not sure why this doesn’t ever hit in breakpoint? They are in the same script, thread = Thread.New() in Ready func. load_chunk([thread, x, z]) works when not on a thread. This has been slowing me down for almost a week now. The worst part is, it originally worked! I didn’t change any of the thread elements in my script, either!

:bust_in_silhouette: Reply From: Ertain

This is probably the problem. From the documentation:

Breakpoints won’t break on code if it’s running in a thread. This is a current limitation of the GDScript debugger.

That certainly explains why it doesn’t hit in breakpoint, thanks!

Aravash | 2021-03-18 20:06