I want my players to be able to go through NPCs as if i simply turned off cancollide. i have tried using collision groups like this:
local phyicsService = game:GetService('PhysicsService')
local plr, npc = 'Player', 'NPC'
local setPlr = phyicsService:CreateCollisionGroup(plr)
local setNpc = phyicsService:CreateCollisionGroup(npc)
phyicsService:CollisionGroupSetCollidable(plr, npc, false)
function addToCollisionGroup(mod, group)
for k, v in pairs(mod:GetChildren()) do
if v:IsA('BasePart') then
phyicsService:SetPartCollisionGroup(v, group)
end
end
end
addToCollisionGroup(workspace.NPC, npc)
addToCollisionGroup(workspace.NPC2, npc)
addToCollisionGroup(workspace.NPC3, npc)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
addToCollisionGroup(char, plr)
end)
end)
I have tried many tings like that, but this is the closest ive gotten. it didnt work. any thoughts?

3 comments
um that didnt work
You have to replace game.Workspace.NPC with the name of your npc
i know