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)```
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.
'''
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)
/'''