Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to unanchor a Model using a script?

Asked by 9 years ago

Hey, guys. So I was trying to make a script that unanchors all the parts within a model:

local allparts = script.Parent:GetChildren()
allparts.Anchored = false

But it didn't turn out so well... If anyone can help me out with this problem, I'd gladly appreciate it. Thanks

1 answer

Log in to vote
2
Answered by 9 years ago

No, Since Anchored isn't a property of Model but however you can unanchored the Child inside the model using in pairs loop which will have the same effect. For example:

for _,v in pairs (game.Workspace.Model:GetChildren()) do
if v:IsA("Part") then--Checks if the Child that is inside the Model is ClassName Part.
    v.Anchored = false
    end
end
0
You should also change "Part" to "BasePart" (for seats and stuff) and add "or v:IsA("UnionOperation")" (unions) funyun 958 — 9y
0
He could do that himself I believe. I only wrote Part because he only mentioned part and nothing else. UserOnly20Characters 890 — 9y
Ad

Answer this question