How can I make players walk through each other including the head?

Hello! I am Koala_Helper! I need help with scripting this. I have scripted this and put it where it belongs and it should make people’s heads walk through, but it doesn’t it makes everything else walkthrough but not the head. How can I fix this?


game:GetService("RunService").Stepped:connect(function()
	for _, player in pairs(game.Players:GetPlayers()) do
		if player ~= game.Players.LocalPlayer then
			local character = player.Character
			if character then
				local head = character:FindFirstChild("Head")
				local torso = character:FindFirstChild("Torso")
				if head then head.CanCollide = false end
				if torso then torso.CanCollide = false end
			end
		end
	end
end)```
1 Like

Is this for R6 characters or for R15?

This is for R6 characters. Do you know how to fix it?

You can use PhysicsService and turn off collisions by using collision groups. There’s a tutorial on how to do it on the developer hub, it’s how I implemented this.

4 Likes

Okay I will try that, if that doesn’t work I will try other ideas.

'''
game:GetService("RunService").Stepped:connect(function()
for _, player in pairs(game.Players:GetPlayers()) do
	if player ~= game.Players.LocalPlayer then
		local character = player.Character
		if character then
			local head = character:FindFirstChild("Head")
			local torso = character:FindFirstChild("Torso")
			if head then 
                  head.CanCollide = false 
			if torso then
                   torso.CanCollide = false 

            end
            end
		  end
	    end
      end
 end)           
 
 /'''   

Try this
(Sorry if i indented incorrectly)

I will try it. I think it will work. Hopefully it will, should I put it in starter gui? And should I make it a local.

Just like @tralalah have said. PhysicsService would be your best choice for no collision with other characters.

1 Like

Yeah that would probably help too.

Okay I made scripts, I will take a screen shot.

Thank you everyone that has been suggesting me ideas on how I can fix it.

1 Like