How do I delete all welds in a model?

Hello everyone,

I have a big tower that I want to make changes to, but I’ve already welded the tower. I would like to know how I can get rid of all the welds in the model so I can make changes, then re-weld the model.

Thanks!

3 Likes

Well you’d have to do it manually unless you have a script that loops through the whole model but like the script will only run in game so I guess you better get to work if ya want it done. Maybe there’s a plugin though that auto detcts welds and removes them but plugins are kinda risky so yeah you can either find a plugin or do it manually

2 Likes

That sucks, if that really is the case. If anyone could find a plugin that could do this kind of thing, that could be very helpful.

3 Likes

A solution could be to make a script that removes the welds from the tower and then hit play in roblox studio and then open the workspace and copy the tower because if the script works well then there will be no welds in the tower and it would just copy and paste to another baseplate.

1 Like

You can use the Moon Animator plugin to do this.

Moon Animator has an Easy Weld tool built into it, and inside Easy Weld is a Cleaner tool that destroys all welds in a model.

Image:
image

It does cost a bit of robux now, though, so I would suggest running this script in the command line instead:

-- delete all welds or motor6ds in a model
-- RUN THIS SCRIPT IN THE ROBLOX STUDIO COMMAND LINE!

local model = workspace.model -- define the model path

for I,v in pairs(model:GetDescendants()) do 
     if v:IsA("Weld") or v:IsA("Motor6D") then
          v:Destroy()
     end
end
1 Like

You will need to paste the script that I sent in the command line at the bottom of roblox studio and hit enter for it to work.

(the box with “Run a command” is the command line)

2 Likes

Hello,

Thank you for the reply. I don’t have enough robux to buy moon animator, and even then, I wouldn’t ever use it. I have enough knowledge on scripting to develop my own script, but I’m just checking here to see if there was another way to do it besides scripting.

3 Likes

Or a better script (that deletes the welds and Motor6Ds of all the models you select):

local Selection = game:GetService("Selection")

for _, model in Selection:Get() do
    for _, instance in model:GetChildren() do
        if instance:IsA("Weld") or instance:IsA("WeldConstraint") or instance:IsA("Motor6D") then
            instance:Destroy()
        end
    end
end

Select the models you want to clear of all the welds, and run this in the command bar.

Please note that I will not be held responsible for any mishaps that may arise from misusing this code.

1 Like

Here’s a script that will go through all the descendants of a model and delete any weld constraints. Attached is a webm showcasing it’s use. Hope this helps :slight_smile:

Simply select a model, then paste this code into the command bar and press enter

local selection = game.Selection:Get()
if #selection == 1 then
	for _, child in pairs(selection[1]:GetDescendants()) do
		if child:IsA("WeldConstraint") or child:IsA("Weld") then
			print(child.Name .. " has been deleted!")
			child:Destroy()
		end
	end
else
	print("Select a model")
end

3 Likes

Good code but using GetDescendants vs GetChildren is more thorough and allows you to check through all levels of nesting in the hierarchy.

2 Likes

in the search bar of explorer type the name of the objects you would like to destroy. all the objects will appear in the explorer. select and delete!
(I think, this has always worked for me)

2 Likes