How can I make a player follow another player, depending on his last movements

So basically I want to create a script where a player follows your player, this can be achieved by MoveTo but I want the player to always stop about 2 studs behind you when you stop and when you walk the player will follow your exact steps meaning that if you did a circle then the player would do a circle as well rather than cut across each time.

I think that this needs pathfinding service but I’m not really sure.

You would have to save the player’s movements into a table or something and then make the chaser do them.