ClarkThyLord / Voxel-Core

Voxel plugin for the Godot game engine!
https://godotengine.org/asset-library/asset/465
MIT License
454 stars 28 forks source link

Static Body Voxel Mesh is not Threadsafe #64

Open miintTeaa opened 2 years ago

miintTeaa commented 2 years ago

VoxelMesh accesses the scene tree and can cause errors while multithreading (if, for example, you want to use it for world generation).

This only happens when it's marked as static_body, and - from what I can tell - functions to make the generated StaticBody and CollisionShape save with the scene. Having a property to disable that would be nice and should be pretty simple.

ClarkThyLord commented 2 years ago

VoxelMesh static_body property makes it so that upon any update to its voxel content it generates and attaches a StaticBody to itself. This can create issues when wanting to use multi-threading, however, as you've mentioned yourself, toggling off static_body will cease this functionality. So I'm not too sure what additional option there could be?