My anti collision script for players is not working anymore

Hi,
I have a script which is turning off player collisions but it’s working only for blocky characters I don’t know
why because there’s a statement v:IsA("BasePart") not v:IsA("Part"). Can someone help?

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

local REGISTRY = ReplicatedStorage.REGISTRY
local PLAYERS_CAN_COLLIDE = REGISTRY.PLAYERS.PLAYERS_CAN_COLLIDE.Value

if not PLAYERS_CAN_COLLIDE then
	Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(function(character)
			for _, v in ipairs(character:GetChildren()) do
				if v:IsA("BasePart") then
					PhysicsService:SetPartCollisionGroup(v, "Players")
				end
			end
		end)
	end)
end

try if v:IsA("BasePart") or v:IsA("MeshPart") then

1 Like

1- Have you created a collision group?
2- If yes, Have you set the collision group collidable to false?

game:GetService("PhysicsService"):CollisionGroupSetCollidable("Players","Players",false)

If both yes, try to use:

if v:IsA("BasePart") or v:IsA("MeshPart") then

Good luck.

1 Like

The ‘MeshPart’ class is derived from the ‘BasePart’ class (the base class of all part classes).

1 Like

ik man but he said its only working for blocky characters

1 Like

Then the issue likely stems from the fact that non-default characters haven’t loaded yet. The following should remedy that.

if not Player:HasAppearanceLoaded() then Player.CharacterAppearanceLoaded:Wait() end

1 Like