S
Sixmen
Guest
Hello!
I've set up a particle system for bullet trails. Every time I click the mouse, a bullet is created which moves towards the mouse. Particles shaped like white lines are created at the bullet object per step, creating a nice trail effect. The problem is that I have set the particle orientation to match the bullet direction.
If I shoot straight it looks fine.
Like this: - - - - - - -
The problem is when I move the mouse around and shoot at random directions the orientation of the particles change mid-motion.
Like this: - - - - / / /
I'm guessing the new particles created at the end of the bullets lifespan take their orientation from the new bullets instead of the original one. Any way to prevent this and make the orientation stay the same throughout the bullets lifespan?
The create event for the bullet looks like this:
The step event for the bullet looks like this:
I would appreciate any input on the matter.
Thank you!
I've set up a particle system for bullet trails. Every time I click the mouse, a bullet is created which moves towards the mouse. Particles shaped like white lines are created at the bullet object per step, creating a nice trail effect. The problem is that I have set the particle orientation to match the bullet direction.
If I shoot straight it looks fine.
Like this: - - - - - - -
The problem is when I move the mouse around and shoot at random directions the orientation of the particles change mid-motion.
Like this: - - - - / / /
I'm guessing the new particles created at the end of the bullets lifespan take their orientation from the new bullets instead of the original one. Any way to prevent this and make the orientation stay the same throughout the bullets lifespan?
The create event for the bullet looks like this:
Code:
image_angle=point_direction(x,y,mouse_x,mouse_y);
//Create system
ps = part_system_create();
//Run script
scr_part_ptrail_init();
//Create emitter
pe = part_emitter_create(ps);
part_type_orientation(global.pt_ptrail,self.image_angle,self.image_angle,0,0,true);
alarm[0]=30;
move_towards_point(mouse_x,mouse_y,20);
Code:
part_emitter_region(ps,pe,x,x,y,y,pt_shape_pixel,1);
part_emitter_stream(ps,pe,global.pt_ptrail,1);
Thank you!