Why does my ragdolls take a while to get up?

Hello There!
I recently made a Combat system for my game and added the feature to ragdoll when you where hitted by the last Combo Hit, it works well but my problem is thats it takes a while for the Dummy to get up and its quite anoying.

Heres a clip:
robloxapp-20211003-1809022.wmv (4.6 MB)

Heres my piece of Code:

function Ragdoll(eCharacter, aCharacter)

	for i, v in pairs(eCharacter:GetChildren()) do
		for _, v2 in pairs(v:GetChildren()) do
			if v2:IsA("Motor6D") and v2.Parent.Name ~= "HumanoidRootPart" and v2.Parent.Name ~= "Head" and v2.Parent.Name ~= "RightHand" and v2.Parent.Name ~= "LeftHand" and v2.Parent.Name ~= "RightFoot" and v2.Parent.Name ~= "LeftFoot" then

				local Socket = Instance.new("BallSocketConstraint")
				local a1 = Instance.new("Attachment")
				local a2 = Instance.new("Attachment")
				eCharacterForRagdoll = eCharacter
				a1.Parent = v2.Part0
				a2.Parent = v2.Part1
				Socket.Parent = v2.Parent
				Socket.Attachment0 = a1
				Socket.Attachment1 = a2
				a1.CFrame = v2.C0
				a2.CFrame = v2.C1
				Socket.LimitsEnabled = true
				Socket.TwistLimitsEnabled = true
				v2:Destroy()
			end
		end
	end

	eCharacter.Humanoid.RequiresNeck = false
	eCharacter.Humanoid.Sit = true

	aCharacter.Humanoid.WalkSpeed = 16
	aCharacter.Humanoid.JumpPower = 50

end

function UnRagdoll(Time)

	local eCharacter = eCharacterForRagdoll

	wait(Time)

	if eCharacterForRagdoll ~= nil and eCharacter ~= nil and eCharacter.Humanoid.Health ~= 0 then



		for i, v in pairs(eCharacter:GetDescendants()) do
			if v:IsA("BallSocketConstraint") then

				v.UpperAngle = 0
				v.TwistUpperAngle = 0
				v.TwistLowerAngle = 0
				local Joins = Instance.new("Motor6D", v.Parent)
				Joins.Part0 = v.Attachment0.Parent
				Joins.Part1 = v.Attachment1.Parent
				Joins.C0 = v.Attachment0.CFrame
				Joins.C1 = v.Attachment1.CFrame
				v:Destroy()

				wait()

			end
		end

		eCharacter.Humanoid.Sit = false

		wait()

		eCharacter.Humanoid.PlatformStand = true

		wait()

		eCharacter.Humanoid.PlatformStand = false

		eCharacterForRagdoll = nil

	end
end

Is there any Solution on this Problem?
Any help whould be greatly appreciated!
Thanks for your time!

are you using r6 or r15? Because I wrote a ragdoll script a while ago and you can have it if you would like

2 Likes

i use r15``````````````````````

What exactly happens when you try to use the unragdoll function? Also, what do you have the Time parameter set to in the function?

1 Like

It could be that the time parameter is too long and so it’s waiting too long for your use case.

1 Like

Mine is r6 but I do have a very good resource for R15 ragdolls

it is toggleable so you can turn it on and off

2 Likes

Well i use the function Ragdoll when i want it to Ragdoll and then in the next line i put the Unragdoll function and put the time parameter for 3 seconds and it waits, when that time passed it Unragolls

Dude, i litearly putted 1 second delay for it to Unragdoll and now its Perfect.

Good! I’m glad it works now. Also, just a suggestion, you should replace the wait(Time) in your function with a task.wait(Time). The new task library released a bunch of improved variants of spawn, wait, and more! With task.wait, it’ll still wait the same amount of time even if your game is experiencing lag.

Anyway, glad your problem is solved now!

1 Like