Turn head collision off

How can I make sure players’ heads don’t collide with anything on the map? I’m trying to do this because as the head grows, they bump into everything… Current code:

local Players = game:GetService('Players')
local PS = game:GetService("PhysicsService")
PS:CreateCollisionGroup('Heads')
PS:CreateCollisionGroup('Parts')
PS:CollisionGroupSetCollidable('Heads', 'Parts', false)

for i, part in next, workspace:GetDescendants() do
    if part:IsA("BasePart") and part.ClassName ~= "Terrain" and part.Name ~= "Baseplate" then
        PS:SetPartCollisionGroup(part, 'Parts')
    end
end

workspace.DescendantAdded:Connect(function(object)
    if object:IsA("BasePart") and object.ClassName ~= "Terrain" and object.Name ~= "Baseplate" then
        PS:SetPartCollisionGroup(object, 'Parts')
    end
end)


 Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(chr)
        for i,v in next, chr:GetChildren() do
            if v.Name == 'Head' then
                PS:SetPartCollisionGroup(v, 'Heads')
            end
        end
    end)
end)
1 Like

Why not try this:

Rather than make collision groups you could just put this script from post #7 and change it to make the Head CanCollide false.

1 Like
--// Put this in StarterCharacterScripts
local Head = script.Parent:WaitForChild("Head",1)

Head.CanCollide = false
2 Likes

Your code would work in a real game situation, but PlayerAdded does not fire in studio because the playeradded event fires before other scripts. Thereroe your playeradded … characteradded code will never fire in studio, leaving your head collidable. Try testing out your code in the game itself instead of studio, because your code seems fine.

1 Like

Tested in game… not working yet :thinking:

Roblox force our head be collidable as u can see, updated every frame gif

:man_shrugging: you can test with RenderStepped or other loop, our head always be collidable… the solution is use Physics Service

:man_facepalming: It won’t work LOL… Change humanoid state to 11…

This may help you: