Distance Matching Locomotion : Giving it a shot!

I got the idea but, how can I do that? I mean in C++ or blueprint just for prototype