The solution of Ch40zzC0d3r works like as charm laugh

so for others that encounter this programm here is the script that i use now and works.


Code:
action e_bullet()
{
	set(my,PASSABLE | BRIGHT );
	my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY | ENABLE_IMPACT); 
	my.event = ice_hit;
wait(1);
	c_setminmax(me);
	my.lightrange = 100;
	my.ambient =255;

	VECTOR temp;//declare temp vector
	while(!surfer1){wait(1);
	}
	while(1)
	{
		if(vec_dist(my.x,enemy.x) >120){
			reset(my,PASSABLE);
		}
		//Set angle towards player
		vec_set(temp, surfer1.x);
		vec_sub(temp, my.x); 
		vec_to_angle(my.pan , temp);

		//Will use relative movement facing the player
		c_move(my, vector(5* time_step, 0, 0), nullvector, IGNORE_SPRITES | IGNORE_PASSABLE);

		//Change angle now so it faces camera
		vec_set(temp, camera.x); 
		vec_sub(temp, my.x);
		vec_to_angle(my.pan, temp);

		wait(1); //The angle will stay this way until the next frame loads (aka visible part of the frame)




		
	

		
		
	}
}


Last edited by Realspawn; 07/12/16 21:05.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain