UE5: Dynamic mesh actor optimize performance

In my last forum question ( UE5: How to spawn Dynamic Mesh Component Actor Dynamically?) ,
I solved the spawning issue with the DynamicMeshActor.
And I’ve implemented the ability to “dig a hole” to BP_DiggableItem with Boolean subtraction operations on dynamic meshes, and the problem is when the number of holes is getting bigger (or duing to the dynamic meshes are more complexly modified?) the program runs more laggy.
I want to know how to optimize performance for dynamic mesh modifications?
The function I want to do can refer to the Steam game DiggingAHole


I made a “Sway” feature for the weapon to make the weapon have a swing effect when rotating the field of view. It can also be seen that the weapon has a noticeable laggy in the back of the video





You should check whether the problem is in the complexity of the final mesh, or in the cost of adding a new cutout if there are many of them (for example, ISM/HISM has a similar “problem”).

If the first, then most likely you will have to combine a large cluster of small cutouts into one large one (and figure out how to do this unnoticeably for the player)

If the second, then the model itself should initially consist of smaller parts, so that it is impossible to create too many cutouts in one part.

One idea I have is that whenever a BP_DiggableItem is subtracted 100 times (for example), I convert the dynamic mesh to a Static Mesh with the same Mesh, and then convert it to a dynamic mesh again, which is equivalent to resetting the mesh’s modify history. I don’t know if that’s reasonable

And UE provides some Simplify nodes, don’t know if I’m using them correctly


Will the cutouts of the Dynamic Mesh be automatically removed after they are completely subtracted? Or that I need to do extra logic to determine if it’s completely subtracted – > and then, I need to manually destory them

The answer depends on whether the FPS increases at the same time)

Unfortunately, me too…

Most likely you will have to manually remove all the small cutouts and replace them with one large one.