0
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ 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? \$\endgroup\$ – DMGregory Sep 7 '19 at 15:13
  • \$\begingroup\$ 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 \$\endgroup\$ – Samuel Fyckes Sep 7 '19 at 16:49
  • \$\begingroup\$ 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. \$\endgroup\$ – DMGregory Sep 7 '19 at 16:54
  • \$\begingroup\$ So having coordinates and when i click somewhere delete the coordinate from the list and regenerate my mesh ? \$\endgroup\$ – Samuel Fyckes Sep 7 '19 at 17:49
  • \$\begingroup\$ Could you make a script example ? \$\endgroup\$ – Samuel Fyckes Sep 7 '19 at 17:50

Browse other questions tagged or ask your own question.