CollisionGroup is not a valid member of PhysicsService "PhysicsService"

Greetings,

I am getting this error on my script after trying to replace some of the older (to be deprecated) code. I don’t quite understand how to do it. The code and error are down below. Thanks.

The error:

The code:


local PhysService = game:GetService("PhysicsService")
local PlayerGroup = PhysService:RegisterCollisionGroup("p")
PhysService:CollisionGroupSetCollidable("p","p",false)

function NoCollide(model)
	for k,v in pairs (model:GetChildren()) do
		if v:IsA"BasePart" then
			PhysService:CollisionGroup(v,"p") --The line where the error happens

		end
	end
end

game:GetService("Players").PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char)
		char:WaitForChild("HumanoidRootPart")
		char:WaitForChild("Head")
		char:WaitForChild("Humanoid")
		wait(0.1)
		NoCollide(char)

		if player.Character then
			NoCollide(player.Character)
		end
	end)
end)

These are the only valid members of PhysicsService:

Its a property now.

v.CollisionGroup = "p"

1 Like

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