WrapTargets breaking from BallSocketConstraints for ragdoll

When a player is ragdolled and they have some layeredclothing or weird bundles their avatar breaks while ragdolled and after.

Im using chrono so the way im ragdolling is creating skeleton body parts attached with ballsocketconstraints and cframing the real body parts to it every frame:

	for _, v in model:GetChildren() do
		if not v:IsA("BasePart") or v.Name == "HumanoidRootPart" then
			continue
		end

		v.CollisionGroup = "Real"
		for _, motor: Motor6D in v:GetChildren() do
			if motor.ClassName ~= "Motor6D" then
				continue
			end
			motor.Enabled = false
			if motor.Name == "Root" then
				continue
			end
			local part0 = real_to_skeleton[motor.Part0] or skeletonFromPart(motor.Part0)
			real_to_skeleton[motor.Part0] = part0
			local part1 = real_to_skeleton[motor.Part1] or skeletonFromPart(motor.Part1)
			real_to_skeleton[motor.Part1] = part1

			part0.Parent, part1.Parent = skeleton_folder, skeleton_folder

			local noCollision = Instance.new("NoCollisionConstraint")
			noCollision.Part0 = part0
			noCollision.Part1 = part1
			noCollision.Parent = part0

			local bsc = createBallSocketConstraintFromMotor(motor, part0, part1)
			bsc.Enabled = true
			bsc.Name = `{v.Name}:{motor.Name}`
			bsc.UpperAngle = limits[bsc.Name] and limits[bsc.Name].UpperAngle or 45
			bsc.TwistLowerAngle = limits[bsc.Name] and limits[bsc.Name].TwistLowerAngle or -45
			bsc.TwistUpperAngle = limits[bsc.Name] and limits[bsc.Name].TwistUpperAngle or 45

			bsc.Parent = part0
		end
	end
...
	moving[model] = RunService.Heartbeat:Connect(function()
		for real, skeleton in real_to_skeleton do
			real.CFrame = skeleton.CFrame
		end
	end)

the skeleton’s torso is positioned to the humanoidrootpart using AlignPosition


on the left is how the avatar is supposed to be
on the right is what happens after ragdolling

1 Like

I think its because Im CFraming the real parts but im not sure

I tried using welds instead but even that doesnt work

update: WeldConstraints do work but now I need to be touching the ragdolled player?
I guess it has something to do with network owership but I thought since the skeleton parts are on the client it would have ownership

1 Like

Alright so instead of creating a skeleton rig and Weld the new rig’s hrp to the old rig’s one then the ragdoll should only be applied on the cloned rig

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