I am making a tower defense game were I want to have a lot of projectiles active at the same time, and I don’t want to spawn a niagara systems per projectile.
Is it possible to have multiple particles that derive from the same system and move towards different actors?
You will need at least one emitter per particle kind.
The question is then: How does a particular particle know “from where” it is spawning? You can make a parameter that controls this, for example, and move it around to spawn different particles from different towers.
Also: How does the particle know what direction it’s going? Similarly, you’d want a parameter for where that is.
The draw-back with this is that you’ll only spawn particles for a given projectile per tick.
There’s also the possibility to spawn particles from other particles. If your projectiles need to constantly spawn particles, and many of them need to do this per tick/frame, then perhaps a better way to set this up is to have one emitter that spawns “projectile position” particles (that you match up to the actual projectile somehow,) and then have a second emitter that spawns off of the location of the particles in the first emitter. The main challenge here is getting the particles to match the simulated projectile positions – you may need to do something like “Upload projectile positions as a procedural texture every frame” to make that line up perfectly, and then have the position update step for that emitter simply read the position out of the texture.
Thank you for the answer! I like the idea of moving around the system to were the particles will spawn.
But is it possible to somehow make an event in the system that spawns a particle and can be called from a BP? Since I don’t want to spawn particles every tick/frame.
For emitters on the CPU, you can use Event Handlers.
You can also set the number of particles to emit to 1 in a burst, and re-trigger the emitter each time you want another particle to spawn.
There might be a third way of doing this, but these are the two that I’ve looked at before and can recall