Hi, just say I have a model of a bridge. How can I make it all fall apart/collapse?
✓ ANSWER ACCEPTED
How can I make a model break?
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
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.

1 comment
Thank you.