CollisionGroup isn't working for players only?

I’m watching a tutorial on collisiongroups and this is how the guy in the video made his. This works for npcs, but it won’t set the collisions between players for some reason so they can walk through eachother. Not only that but players can bump into npcs which is something I don’t want for my game.

local Players = game:GetService("Players")
local Physics = game:GetService("PhysicsService")

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		for i, object in ipairs(Character:GetDescendants()) do
			if object:IsA("BasePart") then
				Physics:SetPartCollisionGroup(object, "Players")
			end
		end
	end)
end)

I am not quite sure how to set it to it works with NPCs but I made a script a long time ago that makes it so players don’t collide, maybe you could do something with it? (Regular Script in SSS)

local PhysicsService = game:GetService("PhysicsService")
local Players = game:GetService("Players")

local playerCollisionGroupName = "Players"
PhysicsService:CreateCollisionGroup(playerCollisionGroupName)
PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)

local previousCollisionGroups = {}

local function setCollisionGroup(object)
	if object:IsA("BasePart") then
		previousCollisionGroups[object] = object.CollisionGroupId
		PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
	end
end

local function setCollisionGroupRecursive(object)
	setCollisionGroup(object)

	for _, child in ipairs(object:GetChildren()) do
		setCollisionGroupRecursive(child)
	end
end

local function resetCollisionGroup(object)
	local previousCollisionGroupId = previousCollisionGroups[object]
	if not previousCollisionGroupId then return end 

	local previousCollisionGroupName = PhysicsService:GetCollisionGroupName(previousCollisionGroupId)
	if not previousCollisionGroupName then return end

	PhysicsService:SetPartCollisionGroup(object, previousCollisionGroupName)
	previousCollisionGroups[object] = nil
end

local function onCharacterAdded(character)
	setCollisionGroupRecursive(character)

	character.DescendantAdded:Connect(setCollisionGroup)
	character.DescendantRemoving:Connect(resetCollisionGroup)
end

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end

Players.PlayerAdded:Connect(onPlayerAdded)

You could combine the scripts, maybe with your CharacterAdded function?

Apparently when I change the avatar to R6 it works perfectly, but R15 it won’t work.

That is weird, I have it set to R15 and it works perfectly fine. Its a normal script is SSS?

I think it’s packages because when I removed my package it worked for R15 as well.

Ok great, glad I could help! If it is the solution then mark it as so.

I guess the only solution would be to remove packages, which i’m unsure of how to do without removing the players entire avatar design.

I just went into GameSettings → Avatar → and forced R15.

https://developer.roblox.com/en-us/articles/Player-Player-Collisions

I recognise that script.

Yes I was looking through my old games and found this I guess that is where I got it from!