Hmmmm what about slice feature? So that I can use it for cut any part that use metal material only for lightsabers like from Star Wars movie series.
What does lock, freeze and other stuff does? Edit: Nevermind I am stupid
I am making API to smoothly migrate from VoxBreaker to this module! Will release soon(ok it will take more time)
Wrote it like in 3 minutesβ¦
--Not done
local RunService = game:GetService("RunService")
local Signal = require(script.Parent:WaitForChild("VoxelDestruction"):WaitForChild("Signal"))
local Settings = require(script.Parent:WaitForChild("VoxelDestruction"):WaitForChild("Settings"))
local VoxelDestruction = require(script.Parent:WaitForChild("VoxelDestruction"))
local VoxBreakerAPI = {}
local Hitboxes = {}
function VoxBreakerAPI:CreateHitbox(Size : Vector3, Cframe : CFrame , Shape : Enum.PartType, MinimumVoxelSize : number , TimeToReset : number, Params : OverlapParams)
local debris, walls = VoxelDestruction.destroy(Cframe, Size, Shape, Params, MinimumVoxelSize, math.huge, nil, false, TimeToReset, false, false)
return debris
end
function VoxBreakerAPI.CreateMoveableHitbox(MinimumVoxelSize : number, TimeToReset : number, Size : Vector3, Cframe : CFrame , Shape : Enum.PartType, Params : OverlapParams)
local Hitbox = Instance.new("Part", Settings.debrisContainer)
task.spawn(function()
Hitbox.Shape = Shape
Hitbox.Size = Size
Hitbox.CFrame = Cframe
Hitbox.Transparency = 1
Hitbox.CanCollide = false
Hitbox.CanQuery = false
Hitbox.CanTouch = false
Hitbox.CastShadow = false
Hitbox.Anchored = true
Hitbox.Name = ("Hitbox%s"):format(tostring(math.random(1, 999999999999999)))
table.insert(Hitboxes, Hitbox)
end)
local HitboxActual = VoxelDestruction.hitbox(Hitbox, 0, false, false, 1, Params, MinimumVoxelSize, nil, nil, nil, TimeToReset, nil, nil, nil)
local Touched = Signal.new()
HitboxActual.Collision:Connect(function(debris, walls)
Touched:Fire(walls)
end)
HitboxActual.WeldTo = function(part)
task.spawn(function()
if RunService:IsClient() then
local connection = RunService.RenderStepped:Connect(function()
if part then
Hitbox.CFrame = part.CFrame
end
end)
local connection2
else
local canRun = true
local connection
while canRun do
if part then
Hitbox.CFrame = part.CFrame
end
task.wait()
end
end
end)
end
end
return VoxBreakerAPI
Still works though
Isnβt VoxBreaker having a major update too?
yeahhhh but I just made an api to fastly migrate from breaker to this since this module is actually more perfomant
Do you know how to make voxels exactly the size you want (1.5, 1.5, 1.5)? They become bigger or smaller relative to the wall.
it splits these into really tiny and thin parts, omg it also lags so much on tiny objects
bro like what is this???
Thereβs an issue with an update I pushed, Iβm working on fixing this.
waiting for fix my sweetie, I really like your module and looking forward to do some contributions
but you updated it 2 months ago
Fixed the no meshing bug!
Sorry.
Did you update the model?
or whar Edit: now module doesnt return anything
Edit 2: nevermind i forgor to change attribute
Edit:3
Edit:4
Why does this happen with gridlock on?
As long as parts are anchored and the attribute is set correctly then there should be no odd occurrences. If the floor is being broken then that means its either parented to an instance which has the attribute or it has the attribute itself.
Turn gridlock off if you donβt want very thin pieces, its an unexpected result from floating point decimals, kind of a tricky thing to fix. Gridlock was intended for neatness so its not a necessary feature to use anyway and I may just remove it.
I updated the model with a bug fix that should bring any lag down so try it if you havenβt already.
no each part is separated and is not parented to other parts so i dont know whar are you talkin about
Hey real question here about the module,
So Iβve been trying to use the .hitbox() function and after doing extensive research itβs still giving me a lot of trouble (maybe I missed crucial info? Iβve been at this the entire night and I canβt get it working)
Essentially the problem is that whenever I use the .hitbox() function on an already existing object (in this case, module) and I move it with the tools provided by studio, it works perfectly fine
Code sample and the structure of the object^
When I load the game in Run mode, or Play mode, whichever,
and I drag it with the tools given by the studio, it works perfectly fine and breaks any surface it comes in contact with
The problem arises when I try to do the same but from an already existing script, which happens to be a module (used for the combat system of my game)
By executing the exact same identical code, after cloning the object, it seems to not be capable of breaking anything, and doesnβt detect any collisions;
Possibly important facts:
The projectile within the module script uses body velocity to move
Iβve given the already existing target object body velocity, and it seemed to work just fine with it, as long as it is not made by the module script
Duplicating the server script while it is inside the object, and enabling it after itβs created within the module doesnβt work either, only seems to work if the Object wasnβt created by the module script
Cloning, duplicating, anchoring, unanchoring the object doesnβt seem to affect it at all as long as it hasnβt been created by the module script
Using the module script for the creation of the object is crucial.
Hereβs a gif demonstrating the difference in activity;
It might be hard to see after snapping to the player perspective, but the projectile does not break the wall or interact with it in any way at all despite being 1:1 identical to the one used at the beginning of the demonstration gif
Why?
edit,
After multiple tests and grasping at straws I found out that the .hitbox() function only and ONLY performs while I am in SERVER view inside STUDIO
final edit and solution for people who are potentially struggling with this
the problem was that the .hitbox() function utilized BindToRenderStep which only functions on a client script, since the server canβt use .RenderStepped() as it requires to detect the rendering frames
line ~893 in main module^
this explains why it only worked in studioβs server view as the server got an active observer (renderer) when you switched to it, allowing BindToRenderStep to work
my solution was to rebind it to HeartBeat which the server is cool with, although I canβt vouch for how good of an alternative that is