Quote:
Superkus' solution is better because it works on any camera and ground height.
, thats true, I used mine only with an almost top-down game (where it work nicely though).

@Yking, I suggest you either try it the other mentioned way or place a red dot through draw_point3d at the 'to' vector so you know what goes wrong (/where the unit wants to rotate to):

Code:
function move_unit()
{
my = UnitThatIWantToMove;

VECTOR to;
VECTOR temp_dir;
ANGLE offset_angle;

while(1)
{
vec_set(to, mouse_dir3d);
vec_normalize(to, 500); //play a bit with 500
vec_add(to, mouse_pos3d);
vec_diff(temp_dir, to, my.x);
vec_to_angle(offset_angle, temp_dir);
my.pan += ang(offset_angle.pan - my.pan) * 0.2 * time_step;

draw_point3d(to, COLOR_RED, 100, 5);

wait(1);
}

}