Collision Groups have a strange behavior

Hi, I’m doing some tests with Collision Groups and I’ve run into an annoying problem.

In my game I need precise collisions between players and to do that I created a collision box for each player part. This is the script:

local playerCollisionGroupName = "PlayerTestColl"
local playerCollisionGroupName2 = "AnimColl"
local playerCollisionGroupName3 = "CollisionOFF"

function CreateCollisions(char)

	wait(1)
	
	local Array = char:GetChildren() 
	
	for i,v in Array do 
		if v:IsA("BasePart") then 
			
			if (v.Name == "UpperTorso" or v.Name == "LowerTorso" or v.Name == "Head") then
				
				v.CollisionGroup = playerCollisionGroupName2				
			else
				
				v.CollisionGroup = playerCollisionGroupName 				
			end

			local part = Instance.new("Part")
			part.Name = "CollisionPart"..v.Name
			part.Size = v.Size
			part.Position = v.Position
			part.Parent = v
			part.Transparency = 0.5
			part.Color = Color3.new(1, 0, 0)
			part.CanCollide = true
			part.Anchored = false
			part.CollisionGroup = playerCollisionGroupName3

			local weld = Instance.new("WeldConstraint")
			weld.Parent = v
			weld.Name = "CollisionWeld"..v.Name
			weld.Part0 = v
			weld.Part1 = part		

		end
	end

end;


game.Players.PlayerAdded:Connect(function(player)

	repeat wait(0.5)
		print("WAIT")
	until player.Character

	CreateCollisions(player.Character)

	player.CharacterAdded:Connect(CreateCollisions)

end)

As you can see in the video below, if the player’s red parts and the blue part have the same collision group, the player cannot walk smoothly on the blue part. When player enable collisions in settings, the red parts collision group is set to “CollisionON”. The blue part in the video is anchored, has collisions enabled, and its collision group is “CollisionON”.

These are my Collision Groups (ignore “AnimColl”):

Any idea how to fix this issue?

Unfortunately I didn’t fix the problem but I found a temporary solution. I increased the Humanoid.HipHeight and this prevented the player from having direct contact with the part.

game.Players.PlayerAdded:Connect(function(player)

	repeat wait(0.5)
		print("WAIT")
	until player.Character

    player.Character:FindFirstChild("Humanoid").HipHeight += 0.1

	CreateCollisions(player.Character)

	player.CharacterAdded:Connect(CreateCollisions)

end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.