Weld part issues

I would like to solder these two parts with the objective that if I move part1, part two moves with it, I made this script but it does not work properly, what am I doing wrong?

local part1 = Instance.new("Part")
local part2 = Instance.new("Part")
local weld = Instance.new("WeldConstraint")

weld.Enabled = true

weld.Part0 = part1
weld.Part1 = part2

part1.Parent = game.Workspace
part2.Parent = game.Workspace

You need to set the parent of the weld constraint.

weld.Parent = part1
1 Like

Ups! You’re right haha my bad, thanks you bro :smiley:

By chance, do you know what’s the difference between: Weld , Snap , WeldConstraint , Motor , and Motor6D? I don’t understand it well… :confused:

WeldConstraint is pretty much just an updated version of Weld. It came out with new physics solver. Probably will work better with other constraints, but I’m not big on physics so I am not sure. I know one different is that WeldConstraints automatically handle the offset, whereas with Weld you need to manually set C0 and C1.

Motor6D connects parts in a way that makes them animatable. You cannot animate a rig welded together, it needs to be connected with motors. I believe Motor is again the updated version of this, but not sure.

Not sure what Snap is, haven’t used it.

You can read up about all of them on the developer hub, the documentation is pretty decent.

1 Like

Thank you very much it is very helpful! :smiley:

1 Like