USE this:
Code:
ANGLE temp_ang;
......
vec_set(vectemp,det_last_target.x); 
vec_sub(vectemp,my.x);
vec_to_angle(temp_ang.pan,vectemp.x);
my.pan += sign(ang(temp_ang.pan - my.pan)) * time_step * 5; // 5 is turning speed

This will make turning a lot smoother, may be this will fix the problem, try.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung