Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

CanCollide wont disable even after I tell it to?

I wanted to make it so players could walk through each other because since my game is on a 2d world I didn't want players getting stuck so I figured id make them un-collidable.

I tried this script but It didnt work XD

local player = game.Players.LocalPlayer

game.Players.PlayerAdded:connect(function()
	if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
		player.Character.LeftFoot.CanCollide = false
		player.Character.LeftHand.CanCollide = false
		player.Character.LeftLowerArm.CanCollide = false
		player.Character.LeftLowerLeg.CanCollide = false
		player.Character.LeftUpperArm.CanCollide = false
		player.Character.LeftUpperLeg.CanCollide = false
		player.Character.LowerTorso.CanCollide = false
		player.Character.RightFoot.CanCollide = false
		player.Character.RightHand.CanCollide = false
		player.Character.RightLowerArm.CanCollide = false
		player.Character.RightLowerLeg.CanCollide = false
		player.Character.RightUpperArm.CanCollide = false
		player.Character.RightUpperLeg.CanCollide = false
		player.Character.UpperTorso.CanCollide = false
		player.Character.Head.CanCollide = false
		player.Character.HumanoidRootPart.CanCollide = false
	end
end)

Umm this is probably the worst way to try and solve this problem but I couldnt think of any other way to script it. Maybe you can?

6 comments

0

Oh... See I looked on the wiki but I couldnt find that one. Maybe I overlooked it, either way thank youuuuu!

0

You cannot set it to false else the player would fall through the game every time XD

0

I know I got it working its all good XD

0

Please add [SOLVED] in your question's name so people like me don't come in seeing if they can answer. kthx

0

Thunder I didnt want to because i was waiting for someone to answer so me and the guy who answered could both get some points.

1 answer

✓ Accepted answer

For some reason, Roblox will not allow you to set players that cannot collide. We can fix this by using collision groups.

Hope this helps!

This discussion is preserved as it was. New answers, comments, and votes are closed.