1 | local part = script.Parent.Parent |
2 | part.Anchored = false |
What are you trying to Unanchor? A BasePart or a Model? It has to be a base part (wedge, part, cylinder, etc) to use the UnAnchor function. If it’s a model you would have to unanchor all of the parts in it. Like this:
1 | local model = script.Parent |
2 | local Part 1 = model.Part |
3 | local Part 2 = model.Wedge |
4 | Part 1. Anchored = false |
5 | Part 2. Anchored = false |
If you are trying to unanchor a model then just do a loop through it and find the baseparts.
1 | local Model = script.Parent.Parent -- Assuming That is the model |
2 |
3 | for i,v in pairs (Model:GetChildren()) do |
4 | if v:IsA( "BasePart" ) then |
5 | v.Anchored = false |
6 | end |
7 | end |
Otherwise if script.Parent.Parent is not a model and not a basepart Anchored is not a property.