How do i make a players head collidable?
I already searched about head collision in the roblox discord server, on youtube and on dev forum but i can’t find anything useful about this.
What do you mean by this? Do you want the entire player’s body to be collidable or just the head? Since if you only have the head collidable it’d still do the same thing if the body was collidable if that makes sense?
I just want to make to head collidable.
Alright, so what you can do is create a collision group, loop through all base parts in the character, and set every BasePart to the collision group except from the head
Someone from the discord just said R15 head doesn’t have collision, but R6 does.
If this is true i can just make all players R6 and the problem will be fixed right?
Here this should work, if you just want the head part to be collidable.
local PhysicsService = game:GetService("PhysicsService")
local Players = game:GetService("Players")
local GROUP_NAME = "PlayerHeadCollision"
PhysicsService:RegisterCollisionGroup(GROUP_NAME)
PhysicsService:CollisionGroupSetCollidable(GROUP_NAME, GROUP_NAME, false)
local function setCharacterCollisionGroup(character)
for _, part: BasePart in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") then
if part.Name ~= "Head" then
part.CollisionGroup = GROUP_NAME
end
end
end
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("HumanoidRootPart")
setCharacterCollisionGroup(character)
end)
end)
They both have collision i’d assume, given the fact they’re both meshparts, and they have the CanCollide attribute, meaning that you should theoretically be able to collide, but I know meshes are a pain sometimes
R6 works, sorry for making u write a script.
Ah, that’s not problem but I tested r15 with the script and just setting the part.Name that is called head to canCollide and it seemed to work? But atleast you found out a solution, make sure you set your comment as a solution for this too ^^