Following a specific path

How can i make an object following my cursor ( but not directly) through a specific path ( something like a city plan) and every time my cursor change location the object would change path so it will stop where my cursor is?