CanCollide only false on the client?

I’m trying to add humanoid ragdolls to my game, but CanCollide is false for every part, only on the client. No idea why this happens. I want every limb, including the torso and head, to collide with everything. But since i set the NetworkOwnership with my grab script, they don’t collide.

function module.NpcRagdoll(char: Model)
	local humanoid = char:FindFirstChildOfClass("Humanoid")
	if not humanoid then return end

	humanoid.BreakJointsOnDeath = false
	humanoid:ChangeState(Enum.HumanoidStateType.Physics)
	humanoid.PlatformStand = true
	
	local function collideChildren()
		for _, part in ipairs(char:GetChildren()) do
			if part:IsA("BasePart") then
				part:SetNetworkOwner(nil)

				part.Anchored = false
				part.CanCollide = true
				part.CollisionGroup = "RagdollParts"

				print("Set " .. part.Name .. "'s collision")
			end
		end
	end
	
	collideChildren()

	for _, joint in ipairs(char:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local a1 = Instance.new("Attachment")
			local a2 = Instance.new("Attachment")
			a1.Name = joint.Name .. "_A0"
			a2.Name = joint.Name .. "_A1"
			a1.CFrame = joint.C0
			a2.CFrame = joint.C1
			a1.Parent = joint.Part0
			a2.Parent = joint.Part1

			local constraint
			if joint.Name == "Neck" or joint.Name == "Root" then
				constraint = Instance.new("HingeConstraint")
			else
				constraint = Instance.new("BallSocketConstraint")
				constraint.TwistLimitsEnabled = true
				constraint.LimitsEnabled = true
			end

			constraint.Attachment0 = a1
			constraint.Attachment1 = a2
			constraint.Name = joint.Name .. "_RagdollConstraint"
			constraint.Parent = joint.Parent

			joint.Enabled = false
		end
	end
	
	collideChildren()
end
1 Like

Update: I tried setting CanCollide to true in the Explorer during playtest, grabbing it, and now they can’t collide on the server. Seems to be a battle of ownership.

Don’t reinvent the wheel please.
Use collision groups instead.

you really love talking about reinventing wheels huh


see that little 3rd line right there? that sets the collision group. wow!

edit: i tried setting CanCollide on the client when a part is grabbed, and it didn’t change anything.

2 Likes

oh you talking about humanoids right.
Well they always were problematic
It will force collision off for limbs.
You can try setting humanoid state to physics/ragdoll
That works… (sometimes doesnt for unknown to me reason)

image

Client could be overriding some properties.
You sure client owning the character initiated this change?

the module is called from the server and i dont think the client changes the state at any point

You dont understand.
Client has to change this state
Not server.That how humanoids work.

1 Like

thank you for passive-aggressively solving my problem!

1 Like

Nono not meant to offend anybody and you especially
That just the way i speak.
Sorry if it offended you mb.

1 Like