# Destroying cubes in combined mesh at runtime [duplicate]

How could I destroy cubes from a mesh? Once i've combined my cube to a single mesh, would it be possible to be able to destroy one of these cube but to keep a mesh ? Ive seen a video where te person show a script to cut square or triangle shapes into a plane, so I tought it might be possible in 3d (Holistic3d is the person). Does anyone have a script to do that ? because I have no clue how it could be done.

• If you could make the mesh with a particular cube in it, what would prevent you from making the mesh without that cube in it? Once you're building your own meshes you have complete control to make them any shape you want, including "the shape of the previous mesh but without this bit over here." So I'm not sure I understand where you're running into a problem here. Can you explain in more detail whee you're stuck? Sep 7 '19 at 15:13
• I don't know how to do it, and i've spent time looking up. And i don't know it it's clear, but i want to be able to destroy any cube. I tought about recreating cube at every location there was before combining exept the one i want to destroy, and then combine them and destroy the old mesh, but i doubt it could be acomplished in one frame without lag Sep 7 '19 at 16:49
• You know you don't have to instantiate a separate cube primitive everywhere you want a cube in your combined mesh, right? All they give you is position data, so you can just as easily generate your mesh from a collection of positions, or booleans representing full/empty slots. So removing a cube just means deleting one position from the collection, or setting one boolean to false, and re-generating the surrounding chunk. This is easily within the realm of one frame's work for reasonably sized chunks. Sep 7 '19 at 16:54
• So having coordinates and when i click somewhere delete the coordinate from the list and regenerate my mesh ? Sep 7 '19 at 17:49
• Could you make a script example ? Sep 7 '19 at 17:50