Player is getting killed by a Weld

I’m building a carry body system for my Hitman-style game. I don’t know why, but I do know that it is when I weld the two characters together that my character suddenly drops dead for apparently no reason. Here’s my current code:

Weld = Instance.new("WeldConstraint", player.Character.HumanoidRootPart)
		Weld.Name = "CarryWeld"
		
		target.Status.BeingCarried.Value = true
		main.Flags[player.Name].CarryingBody.Value = true
		
		local targetHumanoidRootPart = target.HumanoidRootPart
		local humanoidRootPart = player.Character.HumanoidRootPart

		for _,v in pairs(target:GetDescendants()) do
			if v:IsA("BasePart") then
				v.Massless = true
				v.CanCollide = false
			end
		end
		
		targetHumanoidRootPart.CFrame = humanoidRootPart.CFrame * CFrame.new(-1.5, 1.2, 0) * CFrame.Angles(math.rad(270), 0, 0)
		Weld.Part0 = humanoidRootPart
		Weld.Part1 = targetHumanoidRootPart

		target.Humanoid.PlatformStand = true;

If anyone has a solution or a fix, please tell me. Thank you!

It might be pulling the torso away from the head, which kills the player.

Your code works normally, theres a different issue on why the player is dying.

1 Like

Yep, code should work but its just a humanoid issue.

Presumably it does break joints on death which kills the other humanoid? No way to look into humanoid code unfortunately.

Align position is recommended instead:

3 Likes

Tried working with this for a few minutes, worked perfectly.

Thank you for all your responses!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.