[MAYBE IT'S A ENGINE BUG] Lagging All Ragdoll Scripts / ModuleScripts I've researched

I’ve been doing research about ragdoll for about 2 weeks. All ragdoll scripts that seem to work smoothly are old but well written by good people. Due to Roblox updates, old ragdoll scripts (including the current ones) have one critic error.


DEATH

When the user dies and their BreakJointsOnDeath is False, they ragdoll with a lag.

The solution to this is simple, you will tell me to delete the motor6ds of the joints of the character, when I do this, there is a delay of about 2 - 0.5 seconds when the character dies. the user hangs and then ragdolls.

There will be those who say that the reason for this is network ownership, but despite the network adjustments I made in echoreaper’s ragdoll module and deleting motor6d, I could not solve the error I mentioned.


I think this is an engine bug, I would like to ask the size. but I doubt that there is no engine bug, because there are games with ragdoll that run smoothly.


EVERYTHING I SAID APPLIES TO R15!

5 Likes

Maybe send the code before suggesting it’s an engine bug? This is most likely not an engine bug.

1 Like

if u want to test just take any ragdoll module from devforum and try reset

i sending a video from echoreaper’s ragdoll module

https://gyazo.com/06b295459a2b6a76545862043e80f13f

look u can see delay on reset

This is most likely due to latency with the server as when the player dies the server clones their humanoid before it is destroyed by the game. As so it may take a couple of milliseconds for that replication to reach you again

Do you want the code to make your ragdoll work? It works fine for me.
Link: Ragdoll

this is wrong because echoreapers’ module uses duplicates, but after the respawntime after reset it uses it so that the characters still remain in the map.

What is causing the delay in the ragdollMe() function in EchoReaper’s module?

function setRagdollEnabled(humanoid, isEnabled)
	if humanoid:GetState() == Enum.HumanoidStateType.Dead then
		debris:AddItem(humanoid.Parent.Head:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.UpperTorso:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.LowerTorso:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.RightUpperArm:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.RightLowerArm:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.RightHand:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.LeftUpperArm:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.LeftLowerArm:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.LeftHand:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.RightUpperLeg:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.RightLowerLeg:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.RightFoot:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.LeftUpperLeg:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.LeftLowerLeg:FindFirstChildWhichIsA("Motor6D"), 0)
		debris:AddItem(humanoid.Parent.LeftFoot:FindFirstChildWhichIsA("Motor6D"), 0)
	end
	
	
	
	
	local ragdollConstraints = humanoid.Parent:FindFirstChild("RagdollConstraints")
	
	for _,constraint in pairs(ragdollConstraints:GetChildren()) do
		if constraint:IsA("Constraint") then
			local rigidJoint = constraint.RigidJoint.Value
			local expectedValue = (not isEnabled) and constraint.Attachment1.Parent or nil
			
			if rigidJoint.Part1 ~= expectedValue then
				rigidJoint.Part1 = expectedValue 
			end
		end
	end
	
	
	
end

I think what you’re mistaking for an engine bug is just slow replication times. For me, it appears instant because I have low ping (therefore faster replication), but if you’re on any device with higher ping, it will have a delay.

[-] Because I think that if I do something that works with ragdoll when the motor6ds of the character is deleted or the motor6ds enable is turned off, it can be fixed just like in the ragdoll solution (there is a delay in the ragdoll solution, but there is no problem after the setnetworkowner operation)

but i think how can i do that in this script

because ragdoll solution only uses ballsocketconstraint

I want to have ragdoll directly when the character’s motor6ds is deleted, but I still don’t know how to do it. ragdoll solution handles it without even writing a line of code for it, but as I said, there are no hinge constraints.

consider removing or adjusting the debris:AddItem calls.
the delay in the setRagdollEnabled function from EchoReaper’s module is likely due to the usage of debris:AddItem. these calls introduce a slight delay in the ragdolling process.

try this code instead:

function setRagdollEnabled(humanoid, isEnabled)
    local ragdollConstraints = humanoid.Parent:FindFirstChild("RagdollConstraints")

    for _, constraint in pairs(ragdollConstraints:GetChildren()) do
        if constraint:IsA("Constraint") then
            local rigidJoint = constraint.RigidJoint.Value
            local expectedValue = (not isEnabled) and constraint.Attachment1.Parent or nil

            if rigidJoint.Part1 ~= expectedValue then
                rigidJoint.Part1 = expectedValue
            end
        end
    end
end

rest assured I tried over 100 times I did destroy instead of debris I did remove I did .Parent = nil. If you don’t delete the motor6ds, your character will turn into a game with ragdoll as if you were playing a 2 fps game. After my trials, I can easily tell you that deleting the Motor6D’s is not the source of the delay.

After so many tries, I can more or less guess where the error is and I wrote what it is above, but I doubt if I can do this in the ragdoll module of the echoreaper, or rather the technique I think will work on hingeconstraints.