I don't know how to achieve this, it will be used for camera panning. I just need someone to tell me how. (you don't have to write a script)
Well, there are several ways to approach this;
I prefer second way because it's easy and simple to do.