Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | kyla |
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 add_child (the chunk to be added) and remove_chind (the excess chunk)
Now I am experiencing a performance problem
Because of thread safety issues, help thread cannot add_child
I can only add_child() 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