VoxBreaker | An OOP Voxel Destruction module

I’ve been wanting to replicate Jujutsu Shenanigan’s destruction. Would you mind showing me how you’ve done this?

This is how I used the module to get my result. Take a look and see what you can take from it:

My result:
https://vimeo.com/950600011?share=copy

when i try to do it on both the server and client the voxels just dont exist on the client
i dont know if its because im doing it on the client first, and then destroying them on the server without a wait or something though

if you can help id appreciate it

Try doing task.wait(.5) before doing it on the server. I modified the timings in the module to prevent flickering so if it still doesn’t work for you I can send you my version.

thanks for the general server and client fix, i also changed like one time thing in my module so it didnt flicker, but i have this issue where the voxels just kinda keep getting smaller the more times the module is called

image

i dont really know how i would fix this because both im still kinda confused on how the module works and other stuff

if you have any solutions i think theyd be helpful

When looping through the voxels just do:

Voxel:SetAttribute("Destroyable", false)

Since the voxels are clones of the original part the destroyable attribute stays.

Or you can just make the minimum size bigger.

well when i did that it somewhat fixed the problem with the voxels being smaller,
but now theres just excessive amounts of them like this:
image
and sometimes the voxels are just smaller anyway
image
i can get a video if you want to see what im talking about

You should look back at the code I sent. I limited the amount of voxels that can come out per explosion by counting how many there are in the for loop and checking if its above the limit. If it is I just destroy the rest.

And for the sizes, I just set each voxel to a target size (for me 2 by 2 by 2 studs) then randomly add variation to them.

i didnt really want variation to my voxels, and my voxels keep getting smaller and smaller despite the minimum voxel size being set to 3

image

honestly if theres no solution to this can you just send your version

nvm i think i found a fix for this

is this another module you’re using?, and wouldn’t this lag if the voxels are created on the server?

No I am making a destruction module for my game using VoxBreaker. And I do the voxelization and the debris on the client then doing it on the server but deleting the voxels so the physics is only done on the client.

Then make it bigger and just set each voxel to be the exact size you want.

the main problem seems that its like splitting some parts into smaller parts than they should be split which makes a bunch more voxels and so much more lag

UPDATE

All known bugs have been fixed. This includes:

  • Excess models being created → Now only 1 model is created per part, and all voxels of that part are now contained within the model.
  • A delay occurring when the voxels would reset → Now, there is no delay, and voxels reset seamlessly.
  • WeldTo method would not run on the server → WeldTo method now runs perfectly on the server.
  • In some cases, voxels would not be destroyed after the reset time → All voxels are now destroyed properly.
  • Textures, decals, and surface guis would be destroyed after the reset time → The module now fully supports textures, decals, and surface guis.

That’s about it. If anyone has any suggestions or improvements that could be added to the module, then feel free to ask.

And @FlikterIsLinked , I am pretty unfamiliar with github, so as much as I would like to make that repository, I have been trying to figure out how to set it up, but have only been met with confusion. So, unfortunately, I no longer have plans to make a repo for this project. Apologies for my own inexperience, I looked through a few guides on using github, but I got pretty overwhelmed and just couldn’t understand any of it.

2 Likes

Nice update. Tho make sure to filter out parts that dont have their shape set to block:
image

Do you mean if i do weld to in the server, it won’t lag?, and what would be the benefits anyways?

No, there was just a bug before where the WeldTo method wouldn’t run on the server. It can now run both on the server and the client.

1 Like

ohhh, okay

This text will be blurred