I made a combat system for my game, and I am trying to have the character hit with the gun to ragdoll. But for some reason, the character will ragdoll, but the character won’t fall to the ground! I have tried deleting joints, messing around with the humanoid, and other things of that sort, but nothing I do seems to work!
Character after being hit:
You can see the character will stay up, with only their arms and legs going limp. So it is maybe something to do with the HumanoidRootPart, Torso, or Head, but I am not entirely sure.
The code for the ragdoll (Which will run once a part is hit:)
for i, joint in pairs(hitCharTwo:GetDescendants()) do
if joint:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local a1 = Instance.new("Attachment")
a1.Name = "RagdollA1"
local a2 = Instance.new("Attachment")
a2.Name = "RagdollA2"
a1.Parent = joint.Part0
a2.Parent = joint.Part1
socket.Parent = joint.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = joint.C0
a2.CFrame = joint.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
joint:Destroy()
end
end
task.wait(10)
for i, joint in pairs(hitCharTwo:GetDescendants()) do
if joint:IsA("BallSocketConstraint") then
joint:Destroy()
end
if joint:IsA("Attachment") then
if joint.Name == "RagdollA1" or joint.Name == "RagdollA2" then
joint:Destroy()
end
end
local Motor6Ds = game:GetService("ReplicatedStorage"):FindFirstChild("Motor6Ds")
Motor6Ds:FindFirstChild("Neck"):Clone().Parent = hitCharTwo:FindFirstChild("Head")
Motor6Ds:FindFirstChild("Right Shoulder"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
Motor6Ds:FindFirstChild("Right Hip"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
Motor6Ds:FindFirstChild("Left Hip"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
Motor6Ds:FindFirstChild("Left Shoulder"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
Motor6Ds:FindFirstChild("Root Hip"):Clone().Parent = hitCharTwo:FindFirstChild("HumanoidRootPart")
end
end
Motor6D Folder:
If you need me to provide any more things, please ask me! Thank you for reading!
Note: I think I figured out why the rig is staying up. I made the HumanoidRootPart visible, and it seems that it isn’t falling down whatsoever. I have no clue why it is not, maybe some joints or something, but nothing I do seems to make it fall. Any idea why that is?
Character with the HumanoidRootPart visible:
The inside of the HumanoidRootPart:
The RootAttatchment is just something that was already in the rig I got from making it, and it doesn’t seem to affect anything.
Please help! I’ve been stuck on this issue all day!
I tried this but it still doesn’t work!
I put the same ragdoll script into a player ondeath function, and it works just fine. Maybe it is something to do with the joints?
hey Coreshen, I stumbled apon this post, I am as well having a issue with ragdoll, at least for me there seems to be an issue with the neck. I’ll keep you updated if I find anything.
Thank you, this worked for me! I changed the HumanoidStateType to Physics and made RequiresNeck false and AutoRotate false, and that’s all it needed! Thank you for the help, I really appreciate it!