How do I make R6 ragdoll with knees?

You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
A r6 ragdoll with knees

What solutions have you tried so far?
I tried searching on devforum, youtube, reddit and etc.

this Is what I want:

and this Is what I have:

If you think It’s identical It’s not true. Because in the first image knees are changing their position, but mine don’t

I want It to be like this:

this Is my module script:

local RagdollModule = {}
RagdollModule.__index = RagdollModule

local Players = game:GetService("Players")

local function SetCollions(Character)
	for i, part : Part in pairs(Character:GetChildren()) do
		if part:IsA("Part") then
			part:SetNetworkOwner(nil)
			
			part.CanCollide = false
			part.Massless = true
		end
	end
end

local function CreateCollisionParts(Character)
	for _, v in pairs(Character:GetChildren()) do
		if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
			local ColliderPart : Part = v:Clone()
			ColliderPart.Parent = v
			ColliderPart.CanCollide = true
			ColliderPart:ClearAllChildren()
			ColliderPart.Transparency = 1
			ColliderPart.Name = "Collider"
			--ColliderPart.Shape = Enum.PartType.Ball
			
			if v.Name == "Torso" then
				ColliderPart.Size = v.Size
			else
				ColliderPart.Size = Vector3.new(.5, v.Size.Y, .5)
			end

			local Weld = Instance.new("Weld", ColliderPart)
			Weld.Part0 = v
			Weld.Part1 = ColliderPart
			
			for _, i in pairs(Character:GetDescendants()) do
				if i:IsA("Part") and i.Name == "Collider" then
					local NoColl = Instance.new("NoCollisionConstraint", ColliderPart)
					NoColl.Part0 = ColliderPart
					NoColl.Part1 = i
				end
			end
		end
	end
end

local function SetUpHumanoid(char)
	local Humanoid : Humanoid = char:FindFirstChild("Humanoid")
	
	Humanoid.RequiresNeck = false
	Humanoid.PlatformStand = true
end


function RagdollModule.New(Character : Model)
	local self = setmetatable({}, RagdollModule)
	self.Character = Character
	
	return self
end

function RagdollModule:Ragdoll()
	for i, joint in pairs(self.Character:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local a0 = Instance.new("Attachment")
			local a1 = Instance.new("Attachment")
			a0.Parent = joint.Part0
			a1.Parent = joint.Part1
			socket.Parent = joint.Parent
			socket.Attachment0 = a0
			socket.Attachment1 = a1
			a0.CFrame = joint.C0
			a1.CFrame = joint.C1
			
			a1.Name = a0.Parent.Name
			a0.Name = a1.Parent.Name
			
			if joint.Name == "Left Hip" then
				a0.CFrame = joint.C0 + Vector3.new(.5,.5,-.5)
				a1.CFrame = joint.C1 + Vector3.new(.5,0,0)
				
				--[[spawn(function()
					wait(1.5)
					a0.CFrame = joint.C0
					a1.CFrame = joint.C1
				end)]]
			elseif joint.Name == "Right Hip" then
				a0.CFrame = joint.C0 - Vector3.new(.5,-.5,.5)
				a1.CFrame = joint.C1 - Vector3.new(.5,0,0)
				
				--[[spawn(function()
					wait(1.5)
					a0.CFrame = joint.C0
					a1.CFrame = joint.C1
				end)]]
			end
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			joint:Destroy()
		end
	end
	
	SetCollions(self.Character)
	CreateCollisionParts(self.Character)
	SetUpHumanoid(self.Character)
end

return RagdollModule

3 Likes

You’d probably use ik for that. Thats what the blender rig is using

3 Likes

use trigonometry to do this

pls show me the video of yours so i can dig further

You can set constraints to BallSocketConstraint, and you can play animation of a character bending a knee before ragdolling.

Yes, I tried using inverse kinematics, but it didn’t work out well.

As you can see It just sets attachment’s position so that It looks like a knee

There is another video that shows exactly how It works:

			if joint.Name == "Left Hip" then
				a0.CFrame = joint.C0 + Vector3.new(.5,.5,-.5)
				a1.CFrame = joint.C1 + Vector3.new(.5,0,0)
			elseif joint.Name == "Right Hip" then
				a0.CFrame = joint.C0 - Vector3.new(.5,-.5,.5)
				a1.CFrame = joint.C1 - Vector3.new(.5,0,0)
			end

So to initialize a pose for your ragdoll you can start by playing a animation then when it reaches the point you would like you can :AdjustSpeed(0) of your currently playing animation, or just adjust the motors, do the ragdoll and if your character can be posed like in the picture it will.

Can you show me example of this? Because I don’t really understand what are you saying.



i implemented a similar system

does it have to be like this?

Yeah! I want It to look exactly like this. But I want It to be R6.

all i know is that you would probably use trigonometry for this and also my system might look like it works but when the character is facing other directions than front up the knee just rotates to an angle incorrectly like unrealistic

like the leg goes up when its supposed to go down

i couldnt find a solution to it

Hello again! I’ve tried for months making this but still I didn’t make any progress.

Can you help me please?

I FIGURED IT OUT! I just instead of using a ball socket constraint I tried spring and It worked!

1 Like

great work on finding the solution!!! ive also been wondering how to do this as well

though just one question, i tried the spring method but it doesn’t seem to work like this for me, how’d you do it??

There is still work to do

Like legs can look like this:

This is example:

I also have a video:

THE DAMPING SHOULD BE 20 AND STIFFNESS SHOULD BE 100 so It will look better than the photo example

neat!!! ill try it once i can, thanks a bunch!!!

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