VoxDestruct | Voxel Destruction Module

You mean radius and position? I can implement that.

1 Like

Yeah, that’s what i meant

What do you mean by get the debris amount based on the part that gets destroyed?

Automatic debris amount based on the size of the part destroyed, I don’t really know how to explain it. It should use the volume of the destroyed area to create the debris I guess?

I thought about that, but I didn’t want to create too much debris as that can be laggy. Also, it’s not to o hard to go in the script and change the minimum debris size to be more relative to the block destroyed size.

If anything, you can probably make it optional. is it possible to make the minimum size dynamic? I’m so dumb lmao

It’s already dynamic, it gets the size of the part, then adjusts it to be smaller. Though I can include a :SetDebrisSize function?

2 Likes

Yeah, I’m an idiot lmao. If I have more feedback, I’ll tell you.

Small Fixes and Small Update V.01

  • ObjectCache is now being used.
  • setDebrisSize() function to set the debris size relative to the part’s size.
  • voxelizePosition() function which can voxelize parts a specific position, given a radius too. This removes the need of creating a hitbox yourself.
  • Fixed small bugs…
1 Like

Hey! I’m loving this so far and I wanted to request some features.

  1. Can you add a paramter for regenerating the lost parts after a timer? (Or just restoring the part to its previous state)
  2. Can you provide some example code because my debris system is glitched (debris size is incorrect and is destroyed instantly)

Thanks!

EDIT: I modified your script (Thank goodness it’s light) to fix the debris thing but I’m a bit lost on the regeneration, would be appreciated if you could figure that out.
(I just added a speed and duration paramter to :voxelize)

3 Likes

Another issue, rapid usage overloads the module and causes it to stop. Watch Desktop 2025.03.03 - 16.06.47.01 | Streamable

1 Like

Are you able to open up a test place so that we can play and edit the game please?

Yeah, for all the newbies and non-professionals, it’d be pretty helpful to have an open-sourced place as a reference/example that we can dig into.

1 Like

can use athar’s ActorGroup2 module to use parallel luau for greedy meshing and other heavy computational tasks, and an example uncopylocked place for newbies. also, please don’t ever die like the other voxel modules that haven’t been updated in 75 years

Some parts of the code are abit messy, i will try to recode them to eliminate some unnecessary computations

1 Like

I second this. After he adds this, this would be the best destruction module ever.

1 Like

I’d recommend adding a certain time limit in the code before voxels are replaced instead of just having to clean up each voxel they replace after that limit.

An example place has been added for everyone to use!

3 Likes

This works badly client sided. It suffers the same (cache on only issue) that voxbreaker had where parts become different sizes and even parts sometimes don’t show up.

i believe if you wanna fix the issue with parts being different sizes with partcache enabled with the voxbreaker module (the one on the creator marketplace), you would just search for and comment out the v.size = mode it should be located near line 850 - 900. i’m not sure if this will fix it, so if i’m wrong, i’m wrong