This almost works.
The only issue is that the pieces dont actually fill up the window.
the manual method isn’t the best for me. I’m going to have destructible buildings in my game so I dont think it would be too performance friendly if every single part had X amount of little parts in it.
this is EXTREMELY promising.
I tried to use part fracturing system v3 but it requires parts to be positioned a certain way so that wont work for my game.
I tried FragmentSmasher and this is the very promising result I received.
https://gyazo.com/571cd25bc520efcbbdc59883f59d614e
As you can see though there is ONE small issue.
The fragments are always positioned in the same direction. If I can fix that. This would be perfect.
I’m assuming it has something to do with this part of code in the script.
local function CreateQuadrants()
local Quadrants = {}
local Region =
Region3.new(
Vector3.new(CenterPos.X, CenterPos.Y, CenterPos.Z),
Pane.Position + Vector3.new(Pane.Size.X / 2, Pane.Size.Y / 2, 0)
)
local QuadrantA = Instance.new("Part")
QuadrantA.Anchored = true
QuadrantA.CFrame = Region.CFrame
QuadrantA.Size = Vector3.new(math.abs(Region.Size.X), math.abs(Region.Size.Y), math.abs(Pane.Size.Z))
QuadrantA.Parent = workspace
QuadrantA.Transparency = Pane.Transparency
QuadrantA.Reflectance = Pane.Reflectance
QuadrantA.Color = Pane.Color
QuadrantA.Material = Pane.Material
table.insert(Quadrants, QuadrantA)
local Region =
Region3.new(
Pane.Position + Vector3.new(Pane.Size.X / -2, Pane.Size.Y / -2, 0),
Vector3.new(CenterPos.X, CenterPos.Y, CenterPos.Z)
)
local QuadrantB = Instance.new("Part")
QuadrantB.Anchored = true
QuadrantB.CFrame = Region.CFrame
QuadrantB.Size = Vector3.new(math.abs(Region.Size.X), math.abs(Region.Size.Y), math.abs(Pane.Size.Z))
QuadrantB.Parent = workspace
QuadrantB.Transparency = Pane.Transparency
QuadrantB.Reflectance = Pane.Reflectance
QuadrantB.Color = Pane.Color
QuadrantB.Material = Pane.Material
table.insert(Quadrants, QuadrantB)
local Region =
Region3.new(
Vector3.new(CenterPos.X, CenterPos.Y, CenterPos.Z),
Pane.Position + Vector3.new(Pane.Size.X / 2, Pane.Size.Y / -2, 0)
)
local QuadrantC = Instance.new("Part")
QuadrantC.Anchored = true
QuadrantC.CFrame = Region.CFrame
QuadrantC.Size = Vector3.new(math.abs(Region.Size.X), math.abs(Region.Size.Y), math.abs(Pane.Size.Z))
QuadrantC.Parent = workspace
QuadrantC.Transparency = Pane.Transparency
QuadrantC.Reflectance = Pane.Reflectance
QuadrantC.Color = Pane.Color
QuadrantC.Material = Pane.Material
table.insert(Quadrants, QuadrantC)
local Region =
Region3.new(
Vector3.new(CenterPos.X, CenterPos.Y, CenterPos.Z),
Pane.Position + Vector3.new(Pane.Size.X / -2, Pane.Size.Y / 2, 0)
)
local QuadrantD = Instance.new("Part")
QuadrantD.Anchored = true
QuadrantD.CFrame = Region.CFrame
QuadrantD.Size = Vector3.new(math.abs(Region.Size.X), math.abs(Region.Size.Y), math.abs(Pane.Size.Z))
QuadrantD.Parent = workspace
QuadrantD.Transparency = Pane.Transparency
QuadrantD.Reflectance = Pane.Reflectance
QuadrantD.Color = Pane.Color
QuadrantD.Material = Pane.Material
table.insert(Quadrants, QuadrantD)
Pane:Destroy()
return Quadrants
end
CenterPos is the origin of the break. (Where the crack starts)
Pane is the part being destroyed.
I’ve customized the script a bit to fit some things I want but still having trouble making it fit the entire part.
It has something to do with this part of the region3
Pane.Position + Vector3.new(Pane.Size.X / 2, Pane.Size.Y / 2, 0)
That causes the issue where its always angled the same. Not sure how to fix it.
I will mark you as a solution. In FragmentSmasher some kind person actually left some code to adjust the position to fix the problem.