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

How to weld a model to the torso?

Asked by
Nymint 85
8 years ago

So this is quite awkward, i've been stuck with this for 4 hours straight now to the point I'd like some help, and no, i'm not looking forward pre-welding, please.

Say you had a nice sword, composed by many parts, it's anchored, you want to weld it all, directly to your torso in the center the moment you spawn, without loosing it's angles and it's object space position, as if you somewhat used Sword:Move(Torso.Position).

for _,v in ipairs(Wep.Sword:GetChildren()) do
local w=Instance.new("Motor")
w.Part0=v
w.Part1=Torso
w.C0=(v.CFrame-v.Position)
w.Parent=v
v.Anchored=false
end

What this does is keep the angles of the sword as intended, but i've been struggling, just to make it stick with it's object space so I can safely weld it to the torso, instead of all the parts centering completely into the Torso's position turning into a mess, code help is appreciated.

2 answers

Log in to vote
0
Answered by 8 years ago

You can use ManualWelds on the sword first and then go through and turn all the parts Anchored to false and then put the sword where you want it and then weld it to the player's torso. You have to do it one at a time though.

0
I'm afraid that's not what I am looking for. Nymint 85 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

There is a nice trick I learnt a while ago. Get a "Weld all" script from the free models section, then put it into your model. Put that model into lighting. Make sure all parts are unanchored in the model.

Make a script that clones the model into the player when spawned. Then simply insert a weld into any part of the model and weld it to the players torso. The whole model will be welded with it, along with that part because the previous "Weld all" script welded everything together.

Your welcome. Hope I helped.

Answer this question