And this function by a user of the forum doesn't work either. The entity starts turning toward the target then runs and turns randomly???
Code:
VECTOR temp_vec;
int botturnto(ENTITY* ent, VECTOR* targ_vec)
{
vec_diff(temp_vec.x,my.x,targ_vec.x);
vec_to_angle(targ_vec.x,temp_vec.x);
ent.pan -= sign(ang(180+ent.pan - targ_vec.x))*5*time_step;
}
// And the call to the function
botturnto(me,dummy.x);