First of all sorry for my poor english, maybe i didnt expressed myself well:

The algorithm quits working when the sphere comes close to a certain distance to the entity2 because i want it that way, and that behavior its implemented with a simple skill:

Code:


function ds_turnTowardsTarget(entTarget)
{
if(my._ds_turnTarget == 1)
{
you = entTarget;
vec_set(temp,you.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp);
my.tilt = 0;
}
}




I already solved the problem but not the way i want it, i just checked the pan of entity2 at a distance say 1000 quants and then compare that pan with the one when the sphere reached the circle (distance where entity2 no more faces the sphere). So, if the entity2 turned right i know the sphere will travel in the right side of the entity2 and so on.

I know there is another (and correct) way to do it with vector angles but i didnt found the solution.
Thanks.