I’m trying to make a part that will block NPCs from getting into spawns of players. We’re considering using Collision groups but I don’t know which way we should go about it. I’ve considered putting a collide part inside all NPCs that will only collide with the part mentioned earlier.
We’re trying to figure out the most efficient method to make this without lots of load on the server doing collision checks
Collision groups as you’ve mentioned are the best way to go about doing this. You can make a separate collision group for the walls and another one for the NPCs, then just set the latter to the HumanoidRootParts of the NPCs. You’ll have to make sure that the walls don’t collide with the default collision group so that the players can still pass through.
You could also loop through all of the parts in the NPCs so that none of their limbs will clip through the walls.