Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make a model break?

Hi, just say I have a model of a bridge. How can I make it all fall apart/collapse?

3 answers

✓ Accepted answer

You can loop through all of the parts and set their Anchored property to false.

for i,v in pairs(YourBridge:GetChildren()) do
	if v:IsA("BasePart") then
		v.Achored = false
	end
end

1 comment

0

Thank you.

Or if it's Welded then it would be

for i,v in pairs(game.Workspace.Bridge:GetChildren()) do
	if v:IsA("BasePart") then
		v:BreakJoints()
	end
end

Adding on to what 18 said, incase there are nested models/parts.

function breakModel(obj)
	for i,v in pairs(obj:GetChildren()) do 
		if v:IsA("BasePart") then 
			v.Anchored = false
			v:BreakJoints()
		end
		breakModel(v)
	end
end

breakModel(Workspace["ModelName"])

This discussion is preserved as it was. New answers, comments, and votes are closed.