Ant line following system

Would anyone know how to make a group of NPC’s follow a player? I know it’s easy to make an NPC follow a player using MoveTo() but I want a line of NPCs that duplicate each others movements to follow one another, like the body of a snake or ants moving in a line.

If you know how to acheive this or have any ideas, I’d love to hear!

2 Likes

You can just make the first NPC follow the player and make the other NPCs follow the one in front of it:

4 Likes

Here’s the game file if you want it:
Line Pathfinding.rbxl (49.7 KB)

3 Likes

Sorry for the late reply, but I’ve tested the system. All seems moderately good, but the NPCs don’t function very well because they collide with each other. Is there any way to make it so the NPCs don’t collide?

Yes, you can use collision groups. Here is a good resource on them:
Collision Filtering