Particle emission : Give each particle a specific direction


So in my 3D FPS game I want to emit particles when I click, that go where the mouse look. I have all this code working and when I click I use Particle.Emit(1).

To give each particle a specific direction I calcul where is pointing the mouse in local space, and convert this to have the point in world space. Then I simulate the particle in world space and I give it VelocityOverTime with world space coordinated. So each time I emit a particle it have a correct direction.

HOWEVER, if I already have particles going to direction A, and I click again poiting to a direction B, ALL of the particles will go to point B. Even those instanciated with a previous click.
So my question : how do I give each particle a direction like I’m doing but after that they don’t depend anymore of the particle system, so that instantiating new particles will not change their direction?


You need this: Unity - Scripting API: ParticleSystem.Emit

See the second example using EmitParams to overrride properties of only the newly emitted particle(s)