How do you make the player detect one particular wall. I have the player detecting the walls in front of it and I labled the wall as flag2 in the code but it detects everything, even those without a flag set to it, so how could I set it to detect just the wall that I want it to detect?
Code:
action shimmy_move()
{
	set(my,FLAG2);
	my.CREATOR = me;	
}

function move_ledge()
{
	VECTOR wall_ahead[3];
	while(1)
	{
	  c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
	  
     vec_set (wall_ahead.x, vector (70, 0, -20)); // play with 70 and -20
     vec_rotate (wall_ahead.x, my.pan);
     vec_add (wall_ahead.x, my.x);
     if (c_trace(my.x,wall_ahead.x,IGNORE_PASSABLE | SCAN_FLAG2 | SCAN_ENTS |USE_POLYGON) > 0)
     draw_point3d(hit.x,vector(50,50,255),100,3);
     if(HIT_TARGET)
     {
     	draw_text("Wall Hit...",10,10,vector(50,50,255));
     }
     
     wait(1);
     
   }
}



Here is the code that I am using to detect the walls in front of me.