How to make a crumbling/breakable wall

Godot Version

4.3

Question

I am currently making a FPS game that allows you to shoot through and break down walls.

I currently use Csg boxes for my walls and spawn a subtract hole shaped Csg box which works fine until you get more that 20-30 holes at once. So once a wall takes too much damage I want it to crumble. I have the health tracking, but I cannot for the life of me figure out how to make the wall crumble while still looking nice and not making the game freeze for a few seconds.

I would also appreciate any tips for optimizing the holes in the wall. I have tried using a array mesh which I determined to be beyond my skills and voxels which I didn’t think looked very nice.

For the wall crumbling I tried following a tutorial of making the object in blender with cell fracture(20 objects) and used a YouTube tutorial to make it break apart. However the pieces don’t scale correctly which I’m sure I could fix at some point. But the bigger problem is that whenever a wall breaks the game freezes for 3-5 seconds. Is there any alternate solutions to this or ways to optimize it?

From the docs

Note: CSG nodes are intended to be used for level prototyping. Creating
CSG nodes has a significant CPU cost compared to creating a MeshInstance3D with a PrimitiveMesh. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay.

1 Like

I am aware of this, however I could not find a way to get what I wanted to do working. If you have another suggestion I would greatly appreciate it. All I need to do is essentially Boolean subtract a mesh from another mesh during runtime at any point when shot.

Also I managed to find a extension to get the crumbling wall working somewhat well. So I no longer need help with that