NPCs keep running into each other

Just do what it says on the physics service page I linked. In other words, like this.

-- the physics service
PS = game:GetService("Physics Service")
-- makes the collison group
PS:CreateCollisionGroup("NPCs")
--[[ sets the collide value of collision group "NPCs" to false, so all parts under the collision group 
"NPCS" do not collide with each other]]
PS:CollisionGroupSetCollidable("NPCs","NPCs", false) -- group1, group2, cancollide
-- example code as to how to set a parts collision group:
-- game.Workspace["something here"]:SetPartCollisionGroup("NPCs")

now just set every part inside your NPC to the collision group “NPCs” using the example code I gave you.

1 Like

Do I have to do anything else? This is what I just added:

local PhysicsService = game:GetService("PhysicsService")

-- Physics functions
PhysicsService:CreateCollisionGroup("NPC")

PhysicsService:CollisionGroupSetCollidable("NPC","NPC",false) 

He’s not asking you to set canCollide to false, he suggested making a collision group out of all the rigs. This way the rigs can’t collide with each other, but they can collide with anything else.

I’ll try and see what I can do.

local PhysicsService = game:GetService("PhysicsService")

-- Physics functions
PhysicsService:CreateCollisionGroup("NPC")

PhysicsService:CollisionGroupSetCollidable("NPC","NPC",false) 

for i, v in pairs(script.Parent:GetChildren()) do
	if v:IsA("BasePart") then
		PhysicsService:SetPartCollisionGroup(v, "NPC")
	end
end

Is this good? Or do I still have to add more?

2 Likes

Sorry for the late reply, and yes, your good :smiley: try it out and see if it works!

I think the npc stopped moving again after that.

Sorry, could you elaborate? What box are you talking about?