Here is a simple pseudocode example. In other words the general logic is correct but you may not be able to directly copy/paste to test it.

while(my.x)
{
camera.x=my.x;
wait(1);
}

Of course you'll want to offset the position of the camera as well as it's tilt to get the angle and distance you want.