Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use welds better? Problem with alignment.

Asked by 3 years ago

My welds are making the parts have offsets from the original build. What causes this? does moving the parts have anything to do with it? Although i have it weld then unanchor after the weld so I dont see why the positions of the parts are slightly off after the welds.

0
what do you mean by offsets? VVoretex 146 — 3y
0
lets say two parts are next to eachother one at (0,0,0) and the other at (1,0,0) and after the weld ones at (0,0,0) and the other is at (1,0,.1) jamespringles 105 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

Line up the parts prior to welding them, when welding use a "WeldConstraint" which can be found by clicking the "+" icon by an item in the explorer.

Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago
local model = script.Parent


local function modelWeld(model,mainpart)
    for _,v in pairs (model:GetDescendants())do
        if v:IsA("BasePart")  then 
            local weld = Instance.new("WeldConstraint")
            weld.Parent = mainpart
            weld.Part0 = mainpart
            weld.Part1 = v
        end
    end

end

modelWeld(model,model.Grass2)

this happens within serverstorage before the model is copied. after it is copied it is unanchored but has parts that are in positions that weren't in the original

Answer this question