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

Why is the script not unachoring the model i made in the workspace?

Asked by 8 years ago
game.Workspace.Model1.Anchored = false

It's telling me Anchored is not a member of Model1??? what does this mean? :/

1 answer

Log in to vote
2
Answered by 8 years ago

an Instance of type Model does not have a property called Anchored. Anchored is a property of Parts not models. If you want to unanchor a model you will have to unanchor every single part that is inside recursive loop would do it something like

function Unanchor(parent)
    for _, p in ipairs(parent)do
        if p:IsA("BasePart")then
            p.Anchored = false
        end
        Unanchor(p)
    end
end

Unanchor(game.Workspace.Model1)
Ad

Answer this question