Welding messing up random part positions

Hey developers, I have been attempting to make an armour piece attach to a player, and once I welded it, it seems the top-half seemed to turn side wards and fall. I have no idea why and no idea how to fix it.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local parts = script.Parent
		
		for _, v in pairs(parts:GetChildren()) do
			if v:IsA('MeshPart') or v:IsA('UnionOperation') then
				local vestWeld = Instance.new('Weld', char.Torso)
				vestWeld.Part0 = vestWeld.Parent
				vestWeld.Part1 = v
			end
		end
	end)
end)

Whilst player wearing
image

Regular Vest
image

Part hierarchy
image

Any solutions, recommendations or tips would be greatly appreciated.
Thanks.

1 Like

Try using a motor6d and tampering the c0.

I would suggest making it an accessory and using Humanoid | Documentation - Roblox Creator Hub.

What would I change the c0 to?

You will have to mess around with it to get the perfect position. Set c0 to this: CFrame.fromOrientation(anglerX, angleY, angleZ) + Vector3.new(offsetX, offsetY, offsetZ).

If this is confusing, make it an accessory like @Redridge said.

upload a baseplate with the vest and i will check it out.

you could weld all the parts of the vest to one main part which can be a rectangle which is easier to configure, and mess with the C0 and testing it. Or you could position it yourself on a model and find the object space and set that as your C0.

In this situation I would probably create an invisible part the size of the whole vest or at the center of the vest. Also make its Front/Back/Right/Left/Up/Down surfaces face the correct way. Make it not-collidable and weld the vest model to it using WeldConstraints.

Then change the primary part of the model to the invisible part.

Then, to position it just do model:SetPrimaryPartCFrame(HumanoidRootPart.CFrame).

Then create a WeldConstraint, set its Part0 to the invisible part, and Part1 to the HumanoidRootPart and parent it to the invisible part.

You’ve got it, but its side wards, do you know how to turn it the right way round?

image

Rotate the invisible part 90 degrees. Just mess around with its rotation, don’t rotate the other parts with it though, only rotate the invisible part.

Mess around with it until you get the right one.

But in this specific case a 90 degree rotation on the Y axis should fix it (according to what it seems like in the screenshot).

1 Like