Help with making a semi auto weld for clothes

Hello Developers, this is my first post here so I wasn’t sure how to name this. So I’m making a character customization and I’m trying to make a system that’s partially automated, but I’ve ran into a issue with welding the parts. Some parts don’t weld correctly.

This is how its supposed to weld.
image
and this is what happens
image

The only thing I’ve tried is adding a Vector3 attribute the parts that need angling and positioning. After that I edit the welds C0 with the attributes, but It expects a CFrame value.

I’m trying to refrain from using if statements in the code because It goes against the whole systems purpose which is to be semi automated also because plan to add a lot of clothing.

This is my code:

if currentshirt then
	print("Found Shirt!")
	for i,v in pairs(currentshirt:GetChildren()) do
		local shirtParts = v:Clone()
		if shirtParts.Name == "Torso" then
			local weld = Instance.new("ManualWeld",character)
			shirtParts.Parent = character.Torso
			weld.Part0 = character.Torso
			weld.Part1 = shirtParts	
		end
		if shirtParts.Name == "RArm" then
			local weld = Instance.new("ManualWeld",character)
			shirtParts.Parent = character["Right Arm"]
			weld.Part0 = character["Right Arm"]
			weld.Part1 = shirtParts	
		end
		if shirtParts.Name == "LArm" then
			local weld = Instance.new("ManualWeld",character)
			shirtParts.Parent =  character["Left Arm"]
			weld.Part0 = character["Left Arm"]
			weld.Part1 = shirtParts	
		end
		print("welded!")
	end		
end

This is also my first customization system so I’m pretty stumped. I don’t know any other ways to go about this, any tips would help!

1 Like

Hi, I suggest you try offsetting the CFrame of the clothing models to each body part’s CFrame, offsetting the positions (if needed), then using weld constraints instead of welds.

2 Likes

I tried doing this but it ended up being too confusing for me. I ended up making a part then welding the clothes to that part and then welding the part to the body.
Thank you for the suggestion though, it works perfectly fine. :pray: :pray:
image