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

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

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

✓ Accepted answer

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

2 comments

0

You should also change "Part" to "BasePart" (for seats and stuff) and add "or v:IsA("UnionOperation")" (unions)

0

He could do that himself I believe. I only wrote Part because he only mentioned part and nothing else.

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