What am I?

When I get closer my tail grows longer but when I go away my tail leads the way.