I know that :Makejoints()
has been depreciated, and that using :WeldConstraint
is the meta now, but how do I weld MeshParts
together?
I recently commissioned a modeler yo make a low poly humvee model for my game, and whenever I try to do something with it, the humvee breaks every time.
Even when using a regen button that utilized the following code,
model = script.Parent.Parent
backup = model:clone()
enabled = true
function regenerate()
model:remove()
wait(1)
model = backup:clone()
model.Parent = game.Workspace
for i,v in pairs(model:GetDescendants()) do
if v:IsA('MeshPart') and v.Name ~= 'MainPart' then
local w = Instance.new('WeldConstraint')
w.Parent = v
w.Part0 = v
w.Part1 = model.MainPart
end
end
script.Disabled = true
script.Parent.BrickColor = BrickColor.new(26)
wait(2)
script.Parent.BrickColor = BrickColor.new(104)
script.Disabled = false
end
function onHit(hit)
if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
regenerate()
end
end
script.Parent.Touched:connect(onHit)
This still occurs:
https://gyazo.com/4271d8ed9a89916e1d387a0f1e6f7c23
What’s the solution? The entire humvee model is MeshParts