I’m attempting to create a showcase, but I constantly experience one common issue: anchoring parts.
I find anchoring parts to be extremely repetitive and unnecessary, and I was wondering if there were any reliable and safe plugins that I could use to anchor all the parts in a place.
This code from the command bar will do the job if you’re not looking for anything fancier. Note that you cannot undo command bar actions. Pressing ctrl-z will take you to the last history waypoint you created (by moving a part or something…) before running the command, which may be further back than you wanted.
for _,v in pairs(workspace:GetDescendants()) do if v:IsA("BasePart") then v.Anchored = true end end
I’ve heard of some plugins floating around that help you automatically change the default properties on new parts, but I don’t have links to any on hand at the moment.
I would also recommend simply copying and pasting (ctrl-c, ctrl-v) or duplicating (ctrl-d) parts already in your place that have the properties you’re looking for. It’s arguably a lot faster than clicking on the New Part button.
Adding on to what qqtt991 said regarding the command bar, you can add undo/redo waypoints to command bar code by adding the following code before and after the code that is doing the action.
game:GetService("ChangeHistoryService"):SetWaypoint("put any string here, however it must be different than the previous waypoint")
Using the above code before and after will effectively add undo and redo options in case your command line code causes some sort of issue.
I personally use @Sctrx’s method. Periodically click on the workspace service in explorer and press Alt+A. Anchors everything within the workspace, no code needed