VoxelDestruct | Voxelated destruction physics with greedy meshing, hitboxes, and more!

Yeah it’s working great now, thank you!

how can i get the debris parts if i wanted to add something to them, i havent seen anything of this topic in the thread unless i missed it

If you’re using .destroy(), calling the method returns a table of debris and then a table of wall parts. If you’re using .hitbox() you’ll need to use the hitbox events .Stopped and .Collision. These methods returns a table of debris and a table of wall parts too except .Collision will return debris for that collision and .Stopped will return all the debris from the hitbox when its stopped. Keep in mind if you are removing debris or destroying them or returning them to cache you may end up with some nil data in your debris table, just make sure to check that the debris in the table are not nil. Remember to use the .cleanup method on debris instead of destroying them since they need to be returned to cache. Hope this helps!

1 Like

So… I’ve been having this strange issue with the module where for some unknown reason, occasionally, both :destroy() and :hitbox() cause a massive lagspike followed by creation of several hundred, up to thousands of segments of walls,

RobloxStudioBeta_B3SuBHlIcJ

RobloxStudioBeta_Oo4Zi6jiX9

RobloxStudioBeta_AqcTksAInm
^the amount of BreakablePieces spawned after using the .hitbox() function

the amount can range from 1000 to 20000+ depending on the occasion

for weeks and weeks now I’ve been trying to figure out what could be the cause of this but I can’t seem to get a solid grasp on it, any ideas?

Thanks for letting me know!

This is one of the bugs I haven’t had time to fix, there’s an issue with the meshing that I haven’t sorted out, I’ll try to have fix it soon.

Apologies for the inconvenience.

@WindBrine, I published a new version resolving a merge bug. Try using this version and let me know if the problem persists. I am curious to know why wall parts in the image have instances underneath them- this wasn’t an intended result.

If the issue persists, may you please provide your code and let me know what instances are children of your wall part’s. Thanks!

1 Like

i recommend using this rather than PartCache since it has lesser script activities

The instances underneath the wall parts are the segmented parts I believe which are created during the destruction process

ok after thorough testing for an extender period of time it seems like the lag issue i’ve spoken of is gone, thank you.

hey, in your opinion would you say this is a better alternative to voxbreaker, performance wise etc

Is there any uncopylocked testing places for this module, or a how-to video? I think that would be helpful for beginners such as myself.

I can make a how-to right after I release the next update, that’s a nice suggestion! For now, read the documentation and the example code and let me know if you have any questions.

3 Likes

Sent you a PM, wondering if you can help me out. All good if not.

looking really useful, love that youre doing this. will keep an eye out for this and implement it later

grafik
testing this out and getting this error no matter what. default settings, heres my code

local vox = require(workspace.VoxelDestruction)
b=vox.hitbox(workspace.breaking)

b:Start()

tried to pinpoint the error but i cant find this comparison in the code at all lol

i fixed this by replacing line 311 with this

if (voxelSize ~= nil and voxelSize < 0) or voxelSize == nil then voxelSize = 0 end

it doesnt default to anything

Can I know the things that will be added on the next update?

Client sided destruction controlled via server for visuals, server sided destruction without replication so raycasts and NPCs can interact with destruction. Support for meshparts, simplified method calls, HOPEFULLY support for wedge part destruction. Sandbox place for testing as well as a youtube video explaining the update and how the module should be used.

Next update should make the resource very performant while also allowing the server to control everything. Safe to say it will take quite a while to be released, but it will be worth the wait!

5 Likes

This is very intersting…
In my opinion, if what you are saying happens 100% in the next update. I would use this over VoxBreaker.

Im currently trying to add destruction into my game. Ill let you know how it goes haha (Just incase it might help with streamlining bug fixes and the such).

1 Like

That sounds amazing dumbcharlimittt