So, I found a script that make npc uncollide with anything, but is there a way to make npc collide with certain part?
–script
local physicsService = game:GetService('PhysicsService')
physicsService:CreateCollisionGroup('NPCs') -- the NPC collision group
-- we don't have to define a collision group for the workspace since the default one already exists, it's called "Default"
physicsService:CollisionGroupSetCollidable('NPCs', 'Default', false) -- set the NPCs collision group to not collide with the default collision group
physicsService:CollisionGroupSetCollidable('NPCs', 'NPCs', false) -- set the NPCs collision group to not collide with other NPCs
local function setNPCCollisionGroup(npc: Model) -- this function will take an NPC and add all of its BasePart descendants to the NPCs collision group
for i,v in ipairs(npc:GetDescendants()) do
if not v:IsA('BasePart') then
continue
end
physicsService:SetPartCollisionGroup(v, 'NPCs')
end
end
local newNPC = workspace:WaitForChild("CapyBara")
setNPCCollisionGroup(newNPC) -- now with our new NPC, call the function to set all of its descendants to the NPCs collision group