I followed LeehamsonTheThird’s ragdoll tutorial because I’ve never really done ragdolls before. The actual physics work fine, but the legs are being put above the head for some reason?
No idea how to fix this (or what’s causing it, besides maybe the offset values?)
Edit: I forgot the put the actual script lol
game.Players.CharacterAutoLoads = false
local offsets = {
Head = {
CFrame = {CFrame.new(0, 1, 0, 0, -1, 0, 1, 0, -0, 0, 0, 1), CFrame.new(0, -0.5, 0, 0, -1, 0, 1, 0, -0, 0, 0, 1)}
},
HumanoidRootPart = {
CFrame = {CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)}
},
["Right Arm"] = {
CFrame = {CFrame.new(1.3, 0.75, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.2, 0.75, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)}
},
["Left Arm"] = {
CFrame = {CFrame.new(-1.3, 0.75, 0, -1, 0, 0, 0, -1, 0, 0, 0, 1), CFrame.new(0.2, 0.75, 0, -1, 0, 0, 0, -1, 0, 0, 0, 1)}
},
["Right Leg"] = {
CFrame = {CFrame.new(0.5, -1, 0, 0, 1, -0, -1, 0, 0, 0, 0, 1), CFrame.new(0, 1, 0, 0, 1, -0, -1, 0, 0, 0, 0, 1)}
},
["Left Leg"] = {
CFrame = {CFrame.new(-0.5, -1, 0, 0, 1, -0, -1, 0, 0, 0, 0, 1), CFrame.new(0, 1, 0, 0, 1, -0, -1, 0, 0, 0, 0, 1)}
}
}
local Humanoid = script.Parent:WaitForChild("Humanoid")
local HRP = script.Parent:WaitForChild("HumanoidRootPart")
Humanoid.BreakJointsOnDeath = false
Humanoid.RequiresNeck = false
script.Parent.Humanoid.Died:Connect(function()
HRP.CanCollide = true
HRP:SetNetworkOwner(nil)
Humanoid.AutoRotate = false
Humanoid.PlatformStand = true
for i, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Motor6D") and v.Name ~= "RootJoin" and v.Name ~= "Neck" then
v.Enabled = false
end
end
for i, v in pairs(script.Parent:GetDescendants()) do
if not v:IsA("BasePart") or v:FindFirstAncestorOfClass("Accessory") or v.Name == "Handle" or v.Name == "Torso" or v.Name == "HumanoidRootPart" then continue end
if offsets[v.Name] then
local a0: Attachment, a1: Attachment = Instance.new("Attachment"), Instance.new("Attachment")
local BallSocket = Instance.new("BallSocketConstraint")
a0.Name = "RagdollAttachment"
a0.Parent = v
a0.CFrame = offsets[v.Name].CFrame[2]
print(a0.Parent.Name)
a1.Name = "RagdollAttachment"
a1.Parent = HRP
a1.CFrame = offsets[v.Name].CFrame[1]
BallSocket.Name = "RagdollConstraint"
BallSocket.Parent = v
BallSocket.Attachment0 = a0
BallSocket.Attachment1 = a1
v.Massless = true
end
end
end)