My project has 1010chunk
3232+3232 staticbody2d in each chunk
33 chunks around the player will be dynamically generated
Whenever the player moves, the dynamic addchild (the chunk to be added) and removechind (the excess chunk)
Now I am experiencing a performance problem
Because of thread safety issues, help thread cannot addchild
I can only addchild() in the main thread, and add_child() in the main thread will cause the game to get stuck for 0.x seconds, making the game not smooth.
How to solve