Hello! I am working on an RTS game with units. I have a system that makes new EditableMeshes for each new unit that is created, so that I can distort their geometry when they take damage. The Async function for creating a new editableMesh from an existing mesh takes about a second to complete though, so I made it so the editablemesh for each meshid is created only once, and any future units with the same mesh reference that editablemesh instead of creating a new one.
The issue with this, however, is that after using MeshPart:ApplyMesh(), that mesh will continue to update itself to any changes made to the editablemesh from that point on. That means that if 5 units share the same editablemesh and one of them takes damage, all of them will show the effect. Instead, I would like to create the editablemesh only once, but then future units will clone that editablemesh instead of using the same one. The issue with this, however, is that editablemesh has no clone() function. What would be the best solution here?