How to unanchor all the blocks in the workspace in a script

Just wondering how I do this. Interested.

1 Like

Use :GetDescendants().

for _, v in next, workspace:GetDescendants() do
	if v:IsA("BasePart") then
		v.Anchored = false
	end
end
2 Likes

or

game:GetService("RunService").RenderStepped:Connect(function()
	for i, v in pairs(workspace:GetDescendants()) do
		if v:IsA("BasePart") then
1 Like

That would unanchor BaseParts every single frame. I have no idea why you would need that.

Doesn’t work at all. :yum: Not sure why.

Doesn’t work at all. Not sure why.

--Server Script inside workspace/ServerScriptService
for _, Part in pairs(workspace:GetDescendants()) do 
    if Part:Is("BasePart") then
        Part.Anchored = false
    end
end

Try this?