Rig collisions with player

Currently, I am making a tower defense game. I have rigs that follow along a path. The problem is, the player can collide with these rigs, pushing them off the path. Currently my script looks like this for collisions

local PhysicsService = game:GetService(“PhysicsService”)

local GROUP_A = “UntouchableRigs”
local GROUP_B = “Players”

local function ensureGroup(name)
for _, g in ipairs(PhysicsService:GetRegisteredCollisionGroups()) do
if g.name == name then
return
end
end
local ok, err = pcall(function()
PhysicsService:RegisterCollisionGroup(name)
end)
if not ok then
warn(“Couldn’t register collision group:”, name, err)
end
end

ensureGroup(GROUP_A)
ensureGroup(GROUP_B)

PhysicsService:CollisionGroupSetCollidable(GROUP_A, GROUP_B, false) s
PhysicsService:CollisionGroupSetCollidable(GROUP_A, GROUP_A, false)

local function setRigToGroup(rigModel, groupName)
if not rigModel or not rigModel:IsA(“Model”) then
return
end

for _, part in ipairs(rigModel:GetDescendants()) do
if part:IsA(“BasePart”) then
part.CollisionGroup = groupName
part.CanTouch = false
part.CanQuery = false

  end

end
end

local enemyfolder = workspace:WaitForChild(“Enemies”)

enemyfolder.ChildAdded:Connect(function(rig)
if rig:IsA(“Model”) then
setRigToGroup(rig, GROUP_A)

  rig:FindFirstChild("Torso").Changed:Connect(function(property)
  	if property == "CanCollide" then
  		rig:FindFirstChild("Torso").CanCollide = false
  	end
  end)

end
end)

It could be a simple mistake or a huge problem. Whatever you know, please tell me!

Is there another script somewhere that is setting all parts of the players’ character to have the collision group “Players”? If not, then you will need to add that.

that was it! that was my first time using collision service and i think i understand it more now. Thanks for the help