Making crack effect

Hi forum. Today i want learn how i can make a crack effect.
I tried do something but it not that i want

local startpoint = game.Workspace:WaitForChild("StartPoint")

local function MakeCrack(lastpart)
	local part = Instance.new("Part")
	part.CanCollide = false
	part.Anchored = true
	part.Size = Vector3.new(4,0.3,0.3)
	if lastpart == nil then
		part.CFrame = startpoint.CFrame
	else
		part.CFrame = lastpart.CFrame
	end	
	part.CFrame = part.CFrame * CFrame.new(startpoint.Size.X/2,0,0) * CFrame.Angles(0,0,math.rad(math.random(-45,45)))
	part.CFrame = part.CFrame * CFrame.new(part.Size.X/2,0,0)
	part.Parent = workspace
	return part
end

while true do
	game:GetService("RunService").Stepped:Wait()
	local part = MakeCrack(lastpart)
	lastpart = part
end


I want make it like this

(yes i made that in Paint)

1 Like

Script it to have a percentage type system that at the end of every segment of the crack has a 25% (or whatever you find works best) chance of splitting into 2 more cracks, each with the segment of code that may split again.
Seems your script isn’t checking to see the length of the crack it creates. Maybe use a random number generator that decides at the beginning how many loops the code will run through to create segments before splitting again?

1 Like

I watched this. but cant understand how it works. + im too lazy to watch 30 mins vid

I put another link if that might help you. It’s not gonna be something you understand quickly so just keep trying and searching.

You can find programming methods for this. For example, I searched up some programming methods for generating lightning and found some useful links:
Programming Video
Generating Lightning Effect
Forum Post on Lightning
Guide on Generating Lightning

Even though it isn’t the same language, the math still applies.

i want do this
38MUf
but dont know how. In tutorial link that you send heres not so many info to understand.