Its c-script for A6, but should be easy adoptable to A7
Its a very good way to realize a following companion, or even a certain type of "chasing" enemy, that finds his way without having you to implement pathfinding.
---
It also contains a decent ego-shooter WASD movement routine.