Well, the follower desn't directly follow the player, instead, it looks for and go to any crumb left by player while the player is moving. It just like when you're lost in the wood and look for any foot print you can find and follow it.

I never tried the code but it should be plug and play