I tried to ticker with the R15 script to create a ragdoll for R6 but unfortunately, R6 attachments are not made the same way like R15 where it can easily be referenced with some concatenation so it is difficult to make it work. There are just many differently named attachments.
Here’s what I tried:
game.Players.PlayerAdded:Connect(function(player) -- ragdoll implementation
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.BreakJointsOnDeath = false
local died
died = humanoid.Died:Connect(function()
local d = character:GetDescendants()
for i=1,#d do
local desc = d[i]
if desc:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local part0 = desc.Part0
local joint_name = desc.Name
local attachment0 = desc.Part1:FindFirstChild("LeftShoulderAttachment") or desc.Part1:FindFirstChild("RightShoulderAttachment") or desc.Part1:FindFirstChildOfClass("Attachment")
--local attachment0 = desc.Parent:FindFirstChild(joint_name.."Attachment") or desc.Parent:FindFirstChild(joint_name.."RigAttachment") -- original line of code for attachment0
local attachment1 = part0:FindFirstChild(joint_name.."Attachment") or part0:FindFirstChild(joint_name.."RigAttachment")
if attachment0 and attachment1 then
socket.Attachment0, socket.Attachment1 = attachment0, attachment1
socket.Parent = desc.Parent
desc:Destroy()
end
end
end
end)
end)
end)
The result is just an idle broken body with the head stuck inside the torso. I am not sure how to create ragdoll suitable for R6. I seen posts but it did not help that much to me. I do understand how to use BallSocketConstraint and to turn off BreakJointsOnDeath but not how to utilize them to create the ragdoll effect.
If anyone has a solution, I’d be appreciated.