I’m using this script to move an object. sometime it work, sometime not, it move curve, refer to pic
ang = Math.atan2(yy-pass._y, xx-pass._x);
if (pass._x>xx || pass._x<xx) {
pass._x += Math.cos(ang)*spe;
pass._y += Math.sin(ang)*spe;
}
some time it move to b to c first (the curve line) then only to a, i want it move from b to a , is a straight line. how come this happen? thanks for helping