I saw a post a week or maybe more ago about someone making a Voxelizer which just breaks parts into pieces.
Heres how to use!
Copy this script
local Voxelizer = {}
function Voxelizer.Voxelize(Part,XDivs,YDivs,ZDivs)
local function MakePart(Position,Size)
local Voxel = Instance.new("Part",script)
Voxel.Size = Size
Voxel.Position = Position
Voxel.Anchored = true
Voxel.CanCollide = false
Voxel.Material = Part.Material
Voxel.TopSurface = Enum.SurfaceType.Smooth
Voxel.BottomSurface = Enum.SurfaceType.Smooth
return Voxel
end
local Size = Part.Size
local SizeX,SizeY,SizeZ = Size.X/XDivs,Size.Y/YDivs,Size.Z/ZDivs
local TopRightFront = Part.CFrame*CFrame.new(Size.X/2,Size.Y/2,-Size.Z/2)
local BottomLeftBack = TopRightFront:Inverse()
local Off = CFrame.new(-SizeX/2,-SizeY/2,SizeZ/2).Position
for x = 0, XDivs-1 do
for y = 0, YDivs-1 do
for z = 0, ZDivs-1 do
local Color = Color3.new(x/XDivs,y/YDivs,z/ZDivs)
local Pos = Off+TopRightFront.Position+Vector3.new(-x*SizeX,-y*SizeY,z*SizeZ)
MakePart(Pos,Vector3.new(SizeX,SizeY,SizeZ)).Color = Color
end
end
end
end
return Voxelizer
Place it in a module script parented to a normal script
Inside the normal script paste this
local Voxelizer = require(script.Voxelizer) -- Part to module.
Voxelizer.Voxelize(workspace.Part,5,1,5) -- 1st argument = Part, 2nd-4th arguements = Number of divisions on X, Y, Z axis respectively.
Here are a few images
- Nice.
- Good.
- Bad.
0 voters
If this gets positive replies I swear ill commit banana