How do I make a Broken Glass of wedge shape?

Hello! I been trying to script a Glass Broken and I was trying to make a Wedge Shape to make a glass break but I couldn’t script it, so I need some help. Here’s the script.

local glass = script.Parent
local originalGlass = glass:Clone()
local SoundId = "rbxassetid://12222005"
local PlaybackSpeed = 0.5

local function onGlassBroken(player)
	print("Glass has been broken!")
	print("Player: " .. player.Name .. " touched the glass.")
	print("Glass is respawning in 5 seconds...")

	
	warn("Glass has been broken by " .. player.Name)
end

local function respawnGlass()
	wait(5)
	local newGlass = originalGlass:Clone()
	newGlass.Parent = game.Workspace
	print("Glass has respawned!")
end

local function playBreakSound()
	local sound = Instance.new("Sound")
	sound.SoundId = SoundId
	sound.Parent = game.Workspace
	sound.PlaybackSpeed = PlaybackSpeed
	sound:Play()
	sound.Ended:Connect(function()
		sound:Destroy()
	end)
end

local function onTouch(player)
	glass:Destroy()
	onGlassBroken(player)
	playBreakSound()
	respawnGlass()
end

local function onTouched(hit)
	local character = hit.Parent
	local player = game.Players:GetPlayerFromCharacter(character)
	if player then
		onTouch(player)
	end
end

local function connectTouchedEvent()
	glass.Touched:Connect(onTouched)
end

local function initGlass()
	connectTouchedEvent()
end

local function main()
	initGlass()
end

main()
2 Likes

Could you be more precise by “Make a wedge shape”

And show some examples of what you asking,

ps. If your asking how you can shatter glass like Phatom Forces for example, this module might help:

2 Likes

If you use blender, you could make the glass in blender and use cell fracture which makes smashed glass. I have attached a Short if you do want to check it out. https://youtube.com/shorts/Ux8Us5YRE4k?si=K8u1WuCg4usRTF2U

You do not need to use rigid body as shown. Just enable cell fracture, fracture it and then import it into Roblox Studio

Yeah I’ll try but I’m talking about the script to make a unbreakable to turn into wedge.