Ragdoll doesn't work client side

So for some reason there are times where the ragdoll only functions on client side but functions on server side. It seems to be some sort of optimization thing since in certain areas it does work (there’s about 20+ npcs placed on average and it usually ragdolls properly when there’s little to no npcs around) I’m not entirely sure if it’s a setting I need to change or I have to code a work around. Sorry if this isn’t in the right topic, I have no clue where to put it in.

Client side:
Screenshot 2024-12-05 105416
Server side:
Screenshot 2024-12-05 105422

here’s the script

Goblin0.Humanoid.Died:Connect(function()
		if obj:FindFirstChild("Head") ~= nil then
			obj.Head.death:Play()
		end
		local d = Goblin0:GetDescendants()
		for i=1,#d do
			local desc = d[i]
			if desc:IsA("Motor6D") and desc.Name ~= "HatAttachment" then
				local socket = Instance.new("BallSocketConstraint")

				local part0 = desc.Part0
				local joint_name = desc.Name
				local attachment0 = desc.Parent:FindFirstChild(joint_name.."Attachment") or desc.Parent:FindFirstChild(joint_name.."RigAttachment")
				local attachment1 = part0:FindFirstChild(joint_name.."Attachment") or part0:FindFirstChild(joint_name.."RigAttachment")
				if attachment0 and attachment1 then
					socket.Attachment0, socket.Attachment1 = attachment0, attachment1
					socket.Parent = desc.Parent
					desc:Destroy()
				elseif desc:IsA("Attachment") and desc.Name ~= "HatAttachment" then
					desc:Destroy()
				end	

			end
		end

	end)
2 Likes

Is the Goblin’s network owner nil?

No I haven’t. I set the primary part as nil and it somehow works even though I sometimes get errors/warnings and wouldn’t it be like every part of the model? It’s super weird and I’ll wait until I mark this as solution because it pretends to be fixed for a minute every time I try to fix it.

1 Like

actually it might be because I run all this (probably on all goblins) every time a new goblin is made mb
Edit: doesn’t seem like it but whatever the problem I asked for is fixed and I’ll fix this one

1 Like

Yeah so turns out it was only pretending to be fixed… I made it so all the baseparts’ network owner is nil but it still doesn’t work.

I know it’s a bit late and you might have already fixed it, but if you haven’t already, try setting only the primary part’s network owner to nil. I’ve never seen anyone try setting all the base part’s to nil

That’s what I did before and it didn’t work so I thought making all baseparts nil would do something. I tried several things and I still can’t even wrap my head around what could even cause it besides some optimization thing the client/server does.

I tried putting the script into a dummy in studio

Blockquote
if obj:FindFirstChild(“Head”) ~= nil then
obj.Head.death:Play()
end

What is obj?

I made a script that controls all the goblins’ death functions and I just called them obj. I was still having this problem before I made the script I just wanted a script that controls multiple goblins so I don’t have to go back and change all the types of goblins’ death script.

1 Like

I found out that when the ragdoll returns to the original state of no ragdoll, there is a value put into the attachment called “OriginalPosition,” It’s possible that the attachments that are found already have that value put inside them. This prevents them from ragdolling. I’m not sure what these values do, but you can either try removing them or creating new attachments when they die.

1 Like

SO TURNS OUT IT’S NOT THAT BUT FOR SOME WEIRD REASON THE MOTOR6 JUST DOESN’T GET DELETED CLIENT SIDE? HOW… Anyway I guess I’ll just make a remote event to fix this?? Merry Christmas btw.

1 Like

K got it fixed. It lags at the start but atleast it works. I just needed to turn on break joints on death on a local script. (it kinda fixes it, sometimes it just doesn’t but at this point I’ll take what I can get)

1 Like

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