I am making a race car bot and i want it to trace 100 quants ahead of it all the time and if it finds a wall to turn to the angle of that wall (be parallel to it), so i have this in a loop with a wait(1) at the end:
trace_mode = ignore_passable + ignore_models;
trace_to.x = my.x + (100 * cos(my.pan));
trace_to.y = my.y + (100 * sin(my.pan));
the_result = trace(my,trace_to);
if (the_result != 0) // if it found a wall
{
vec_to_angle(the_result_angle.pan, normal);
my.pan = the_result_angle.pan + 90;
}
then under that i have the code to move it foward according to its pan. It doesnt work. Can any one help?