Try this:

var cam_dist = 200;
var cam_height = 30;
var cam_speed = 2;
var camGoal[3];

function cam_follow()
{
while(1)
{
vec_set(camGoal[0],vector(-cam_dist,0,cam_height));
vec_rotate(camGoal[0],player.pan);
vec_add(camGoal[0],player.x);
//smooth out movement:
vec_diff(temp,camGoal[0],camera.x);
vec_scale(temp,cam_speed*time_step);
vec_add(camera.x,temp);

vec_set(camera.pan,player.pan);
wait(1);
}
}

KiwiBoy, I think your code may not work with a game where you can tilt more than 90 degrees... not sure if that's what you want though, micmac.


~"I never let school interfere with my education"~
-Mark Twain