CanCollide script not working

I’m making a ragdoll system. Basically when you turn the bool value to true it ragdolls your character, but I have a problem with one script. When ragdolling, your character clips into the ground(Legs and arms), so I made a script which turns on the collision of them, but it doesn’t work for me, here’s the script:

	if humanoid.Health ~= 0 then
			for i,v in pairs(character:GetChildren()) do
				if v:IsA("MeshPart") then
					v.CanCollide = true
				end
			end
			humanoid.Parent:FindFirstChild("Humanoid").PlatformStand = true
		end
		humanoid.Parent:FindFirstChild("HumanoidRootPart").CanCollide = false
1 Like
  1. Is it the whole script? EDIT: I’m sure it isn’t
  2. Keep in mind that as soon as the script sets PlatformStand property to true 2 lines later no matter what very quickly the script sets the property to false.
1 Like

I don’t think this chunk is necessary. If you already have a path to the Humanoid as you were able to access it here:

You don’t need the Humanoid.Parent lines at the bottom of your script. I don’t know if this will help or not, but it might.