Hello,
I'm trying to create a solid laser line that shoots from the ship to a certain distance via the mouse. Here is my code:

Code:
function weapon_fire() {
	vec_for_vertex (gunLeft, player, 679);
	vec_for_vertex (gunRight, player, 737);
	if (mouse_left) {
		if (laserActive != 1) {
			tracer = ent_create("bullet.mdl",nullvector,NULL);
			effect (weapon_laser, 1, gunLeft, nullvector);
		}
		laserActive = 1;	
	}
	
}

//Laser weapon
function weapon_laser(PARTICLE* p) {
		p.flags |= (BRIGHT | BEAM | TRANSLUCENT);
		p.event = laser_fade;	//Move to faster function
		p.size = 0.3;
		p.bmap = laser; //the effect bitmap	
}

function laser_fade(PARTICLE* p) {
	if (mouse_left == 0) {
		p.lifespan = 0;
		laserActive = 0;
	}else{
		p.lifespan = 100;
		vec_set(p.x,gunLeft);
		vec_set(mouseTemp,vector(mouse_pos.x,mouse_pos.y,200));
		vec_for_screen(mouseTemp,camera);
		vec_set(temp,mouseTemp);
		vec_set(p.vel_x,temp);
		vec_set(tracer.x,temp);
	}
}


The "tracer" object works fine and stays at the mouse position as it should. The particle line does not. It moves when the mouse is moved (as it should) but it does not always shoot at the mouse. (Often times the laser will be shooting below the plane when the mouse is to the left of it, etc)

Thank you