I tryed to move an entity over a path with smooth turning (i dont want to use spline from manual) but after a while it doesnt work anymore...it has something to do with angles but i dont know how to fix it, can someone help? smile

Code:
action PLAYER_PATH()
{
	VECTOR move_me;
	VECTOR target_node_pos;
	
	ANGLE temp_turn;
	
	var temp;
	var target_node_num = 1;
	
 
   path_set(me,"path_player");
	path_nextnode(my,1,1);
	path_getnode(me,target_node_num,target_node_pos.x,NULL);
	
	set(me,PASSABLE | INVISIBLE);
	
	wait(1);
	
	while(1)
	{
		camera.x = my.x;
		camera.y = my.y;
		camera.z = my.z;
		camera.pan = my.pan;
		camera.tilt = my.tilt;
		camera.roll = my.roll;
		
		/////////////////////////////////////////////////////////////////////
		//////							Path instructions							//////
		/////////////////////////////////////////////////////////////////////
		
		//get target node position and put into target_node_pos		
		if(!path_getnode(me,target_node_num,target_node_pos.x,NULL))
		{
			target_node_num = 1;
		}
		
		//if close to target node, take next node as target
		if(vec_dist(my.x,target_node_pos.x) < 150)
		{
			target_node_num += 1;
		}
  		
		vec_set(temp,target_node_pos.x);
  		vec_sub(temp,my.x);
  		vec_to_angle(temp_turn.pan,temp);
		
  		if(my.pan < temp_turn.pan)
  		{
  			my.pan += (abs(my.pan-temp_turn.pan) / 10);
		}
		else
		{
			my.pan -= (abs(my.pan-temp_turn.pan) / 10);
		}
		
		if(my.tilt < temp_turn.tilt)
  		{
  			my.tilt += (abs(my.tilt-temp_turn.tilt) / 10);
		}
		else
		{
			my.tilt -= (abs(my.tilt-temp_turn.tilt) / 10);
		}
  		
		move_me.x = 25 * (key_shift+1) * time_step;
		
		c_move(me,vector(move_me.x,0,0),nullvector,GLIDE | IGNORE_PASSABLE);
		
		wait(1);
	}
}