So i have a doomspire type game but the problem is all the parts in the tower are welded to another part in the tower using WeldConstraints. This means that when you shoot the rocket launcher it sometimes leaves floating parts.
I was wondering if there’s a way to have the parts welded to only the parts around it to prevent this or something.
Just Weld each Part that sits on top of another Part to the one directly below it.
This should allow the rocket launcher to blow them up in a more realistic way.
Build a small section of the tower with all the welds you need in it, but don’t join the bottom row to anything yet.
Copy/Paste or Ctrl D to duplicate that section of tower and place it on top of the first section.
Weld the bottom bricks of each section to the top bricks of the previous section.
Not ‘automatic’, but it should save you a lot of time.
local tower = game.Workspace.Map.BLUE
-- removing old welds
for _, wc in pairs(tower:GetDescendants()) do
if wc:IsA("WeldConstraint") then
wc:Destroy()
end
end
local welds = 0
-- creating new welds
for _, v in pairs(tower:GetDescendants()) do
if v:IsA("BasePart") then
local touching = workspace:GetPartBoundsInBox(CFrame.new(v.Position),v.Size)
for part in touching do
local weld = Instance.new("WeldConstraint",v)
weld.Part0 = v
weld.Part1 = touching[part]
welds+=1
end
end
end
print("created "..welds.." welds")