Ok so I got the problem when I try to weld a helmet model to the player, it strangely offsets, it is at the head of the player but offsets and it has the completely wrong rotation and I got no idea how to fix it, I searched around topics and couldn’t find one which could help me, so I hope someone can help me.
Script:
local armorToWeld = subClassUniforms["Helmet"]:Clone() -- weld armor
if not armorToWeld or not char:FindFirstChild("Head") then return end
if armorToWeld.PrimaryPart then
local armorWeldHead = Instance.new("WeldConstraint")
armorWeldHead.Part0 = char["Head"]
armorWeldHead.Part1 = armorToWeld.PrimaryPart
for _, part in pairs(armorToWeld:GetDescendants()) do
if part:IsA("Part") or part:IsA("MeshPart") or part:IsA("UnionOperation") then
part.Anchored = false
part.CanCollide = false
end
end
armorToWeld:SetPrimaryPartCFrame(char["Head"].CFrame)
armorWeldHead.Parent = armorToWeld
armorToWeld.Parent = char
end