Voxel physics is a brand new module designed to make voxel physics destruction like tearDown possible with just a line of code.
Here’s a list of the current features :
voxelizeHitbox
The core function of the module (the only one you need lol). This function works by taking as input a
target
(the part that you want to affect with physics) and asubtractor
(the part that you want to subtract from thetarget
). The crazy thing about this, is that by not giving anytarget
input, the code will automatically find and subtract voxels in real time. There are also a smll library with custom effects that will affect the debris found, such asexplosion
anddestroy
. Here’s a showcase :
voxelizeAll
This function lets you completely voxelize totally any object given a
target
and adivider
value (that will determine the number of voxels). This is not as useful as voxelizeHitbox. Still it can come handy in some situations
More showcases
Player that falls into different layer of wood.
This shows perfectly the voxelizeHtibox function in action
Final notes
This module was made entirely by @gianfragolo (me), but thanks to @Bartokens for inspiration. Also dont mind asking if you have any feedback/suggestion for this system, ill sure answer quickly since i dont have a life.