Why are the limb's CanCollide property not getting set to true?

I’m trying to make a ragdoll function, the ragdoll part works but the limb’s (Left arm, leg. Right arm, and leg) CanCollide property isn’t getting set to true. I have put print statements inside to see if it is even running and getting referenced and if it is correct. I have attempted this on mainly a Rig and another Player but no luck. Any help would be appreciated since I don’t know much about this sort of stuff.

for _, v in pairs(humanoid.Parent:GetDescendants()) do
			if v:IsA("Motor6D") then
				local Attachment0, Attachment1 = Instance.new("Attachment"), Instance.new("Attachment")
				Attachment0.CFrame = v.C0
				Attachment1.CFrame = v.C1
				Attachment0.Parent = v.Part0
				Attachment1.Parent = v.Part1

				-- Store the original properties
				originalProperties[v] = {
					Attachment0 = Attachment0,
					Attachment1 = Attachment1,
					Parent = v.Parent
				}

				local BSC = Instance.new("BallSocketConstraint")
				BSC.Attachment0 = Attachment0
				BSC.Attachment1 = Attachment1
				BSC.Parent = v.Parent

				v:Destroy()
			elseif v.Name ~= "HumanoidRootPart" and v.Name ~= "Torso" and v.Name ~= "Head" and v.Name == "Left Arm" or v.Name == "Right Arm" or v.Name == "Left Leg" or v.Name == "Right Leg" then
				humanoid.PlatformStand = true
				wait(0.1)
				v.CanCollide = true
				wait(1)
				v.CanCollide = false
				wait(0.1)
				humanoid.PlatformStand = false
			end
		end

I can also include the full script if needed

For what ever reason (probably relates to how humanoids work), limbs can’t have their CanCollide property edited, I don’t believe any body parts can. You would need to make a new part, weld it to the limb, and then add a NoCollisionConstraint between the fake body part and the real body part, or work with collision groups to ensure the real body parts don’t collide with the fake ones but can collide with the world so you get a proper ragdoll and not one where the limbs pass through parts.

I’m not sure if you’re working with R6 or R15 but if it’s R15 you may need to create a tree of what body parts can collide with which other body parts (ie. you wouldn’t want the lower leg to collide with the upper leg, wouldn’t want the foot to collide with the lower leg, etc…) and create additional NoCollisionConstraints for each of these relations

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