Hello. I recently found this script that let's you unanchor all of a group. I tried this, but it didn't work. Here is the script:
function unanchore(obj) for i,v in pairs(obj:GetChildren()) do if v:IsA("BasePart") then v.Anchored = false end unanchore(v) end end unanchore(workspace.Building) local a= Instance.new("Explosion") a.Parent = game.Workspace a.Position =Vector3.new( -140.07, 1.5, -133.87 )
To unanchor everything inside of a model then you're going to want to use :GetDescendants()
instead of :GetChildren()
.
What :GetDescendants()
does is that it returns every child in the model so you can unanchor each one of those children if they're a part.
What :GetChildren()
is doing is its returning only the children of the model you're looking for. What about the children inside those parts/models?
--Corrected unachore to unanchor because it bugs me. function unanchor(obj) for i,v in pairs(obj:GetDescendants()) do if v:IsA("BasePart") then v.Anchored = false end unanchor(v) end end unanchor(workspace.Building)