Need Help With Both collision groups must be valid

Error: Both collision groups must be valid.

What I’m Making, A Cage Like Slime Rancher Players Can Walk In And Out But Entity’s Can’t Leave The Cage

local PhysicsService = game:GetService("PhysicsService")

game.Players.PlayerAdded:connect(function(plr)
	repeat wait() until plr.Character
	local char = plr.Character

	local Z_Player = PhysicsService:GetCollisionGroupId("Z_Player")
	PhysicsService:CollisionGroupsAreCollidable(plr, Z_Player, false)
	
end)
1 Like

CollisionGroupSetCollidable ( string name1 , string name2 , bool collidable )

You don’t need ID, just the string. Also there will need to be a valid collision group for the player.

1 Like

Z_Player Is The Player Value, And Walls Is The Object The Player Should Be Able To Walk Through