Parts Automatically Anchored

When you build in studio you build it all, sometimes a large development. Which when you’re done you join the game and everything is unanchored and falling apart. So you try to go into studio and try to make it all to anchor, but it’s too many parts so it lags you. There should a button that automatically allows you to anchor it and one where you can turn it off and anchor it by hand. That would make it easier to make sure that you’re able to anchor your game without any issues and no lag when creating it.

8 Likes

I agree with you, I have a habit of forgetting to anchor my bricks leading it to lag once testing.

5 Likes

The lag is probably due to the (tens of?) thousands of selection boxes appearing all at once. You can iterate through all the parts in workspace and set their Anchored property to true via script.

for _, v in pairs(workspace:GetDescendants())
    if v:IsA("BasePart") then
        v.Anchored = true
    end
end
6 Likes

The script makes it easier, thank you for that. I will put it in every game of mine. But what about the parts that you don’t want anchored?

If the number of anchored parts vastly outnumber the number of un-anchored parts, then anchoring every part first is probably more efficient.

Name your bricks, and if you dont want a certain brick(s) to be anchored, type
for _, v in pairs(workspace:GetDescendants())
if v:IsA(“BasePart”) and v.Name = “Name of brick” then
v.Anchored = false
Else
v.Anchored = true
end
end

1 Like

I believe the intent was for you to paste that as a command in studio, when the game isn’t running, to anchor the entire game there. It’ll cause a ton of lag at the start if you try to have it as an actual script in a running game with lots of stuff in it.

Though, you can also do the same thing by selecting the workspace in the explorer window and hitting the anchor button under the model tab at the top.

Now you have all parts anchored, you want something to anchor all new parts? This is by no means a perfect, flawless plugin, but I created this a while ago and eventually abandoned it because it wasn’t my main focus although I may update it in the future. It has a few bugs but for your use case, it should do the job. It has persisting setting so you can configure default properties of all new instances whilst the plugin is active, feel free to insert the model in order to edit and re-upload it. Let me know if you find any huge problems which make it unusable and I’ll push an update for it.

What you could do is to make sure that you anchor the everything when you make it so you don’t have this issue. Or you could select everything and click the anchor tool in studio.

*Why do I keep accidentally replying to the wrong person .-.

1 Like

If you go to the “HOME” tab at the top of studio, about in the middle at the bottom there’s a button called “Anchor” that will allow you to anchor an entire model or multiple selected models at the click of that button.

EDIT: It also allows for un-anchoring a model with ease.

You should have a set template of building meshes and bricks you require to build that you publish as a model. Simply have it anchored and place it into studio every time you start a project. Anchoring the items beforehand would also be useful, however.

Select “Workspace”
Press “Anchor” in the ribbon bar

Everything in the workspace is now anchored

Video for the confused:

8 Likes

Yeah, this is something I’ve always been annoyed by. Would love to see it be defaulted to anchored

Neither that nor the original use the equality operator instead of the assignment operator though. (‘=’ in the if-statement should be ‘==’)

Imo they should let us make our own default Instances, for more than just changing a default part’s anchored property. I think someone else suggested it for Frames, because usually, most of us change all their default properties. This isn’t as important, but could be considered as it’d make development more efficient.

2 Likes