Weird Ragdoll Bug

I made a ragdoll module that i want to use for a combat game, Whenever someone dies, they ragdoll just fine, But when they get knocked back, their limbs goes through the floor, Despite using the same module script

Ragdoll is fine in this video, ignore that it stands up

In this video, the limbs are clipping

Module Script Of Ragdoll

local ragdoll = {}
ragdoll.__Index = ragdoll





function ragdoll:newragdoll(character)
	
	local colconstraint1 = Instance.new("NoCollisionConstraint")
	colconstraint1.Parent = character["Left Leg"]
	colconstraint1.Part0 = colconstraint1.Parent
	colconstraint1.Part1 = character.Torso
	colconstraint1.Enabled = true
	local colconstraint2 = Instance.new("NoCollisionConstraint")
	colconstraint2.Parent = character["Right Leg"]
	colconstraint2.Part0 = colconstraint2.Parent
	colconstraint2.Part1 = character.Torso
	colconstraint2.Enabled = true
	
	local raycastparams = RaycastParams.new()
	raycastparams.FilterDescendantsInstances = {character}
	raycastparams.FilterType = Enum.RaycastFilterType.Exclude


	--velocity.VectorVelocity = Vector3.new(1,-10,0)
    character["Left Arm"].CanCollide = true
    character["Right Arm"].CanCollide = true
	character.Humanoid.PlatformStand = true
	for _,joint in pairs(character:GetDescendants()) do
		if joint:IsA("Motor6D") and joint.Parent ~= character then
			--if joint:FindFirstAncestor("Accessories") then return end
			local socket = Instance.new("BallSocketConstraint")
			local a1 = Instance.new("Attachment")
			local a2 = Instance.new("Attachment")
			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.Parent.CanCollide = true
			joint:Destroy()
		end
	end
end





return ragdoll

Module script of my combat where it calls the ragdoll (I do other stuff in this script but this is the important one as it detects hitbox too)

elseif State == "Hit" then
		local hitsound = game.ServerStorage.Audio.Hit:Clone()
		hitsound.Parent = Hit
		hitsound:Play()
		local classinfo = BF:Invoke(Character)
		if
			math.floor((Character.HumanoidRootPart.Position - Humanoid.Parent.HumanoidRootPart.Position).Magnitude)
			<= 6
		then
			Humanoid:TakeDamage(classinfo.Damage)
			if not Character.Values.Stun.Value then
				stun(Humanoid, 1)
			end
			if Character.Values.Combo.Value == 4 then
				print(Humanoid.Parent)
				ragdollmodule:newragdoll(Humanoid.Parent) -- CALLING THE RAGDOLL
				knockback(Humanoid, Character,40,0.2)
			end
		end
		hitsound.Ended:Wait()
		hitsound:Destroy()

Client side Of Ragdoll

local humanoid = game.Players.LocalPlayer.Character.Humanoid

humanoid.Died:Once(function()
	humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
	humanoid:ChangeState(Enum.HumanoidStateType.Physics)
end)

Please let me know what im doing wrong :pray:

When a player dies, all their Parts become CanCollide true so they don’t just fall through the floor.
In normal play your limbs are CanCollide false, so when you ragdoll and don’t change them true they drop through the floor.

EDIT
Unless that’s been changed with the newer character controllers as far as I know this is a property that has to be reset every frame, not just once.

1 Like

Im aware,
image
i have it set right here when ragdoll, but when i see the properties on the explorer, for some reason they are set to false and i dont have any script that interacts with the arms

Sorry, don’t know if you saw the edit in the previous post I was doing just before you replied.

I apologize i havent, i’ll try to set up a heartbeat to keep the arms collided

1 Like

So it Kinda works, thanks for that, but i can move spin my character with my shift lock and the camera becomes quite buggy (it wobbles), do you know if i can do something about it?

Honestly I’ve never experimented with it.
I think your camera is locked to your head, so if it’s ragdolling it’ll track that.

I just found out how to fix it, I put the camera to track the head, cause it tracks the whole body, thanks for the help, the ragdoll require some optimization but for now it will do, thanks alot

1 Like

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