Alternate particle ID Niagara

Hello!

I’m currently trying to wrap my head around what seems like a pretty simple problem. Essentially, I want to apply specific values to particles in a niagara system depending on their particle ID value. Like an alternation where every other particle ID has a specific value or “Mask” to apply different things to those specific particles. Odd numbers would get a sprite facing value to face upwards and even to face forward for example.

Currently I have a very barbaric setup as a prototype, where we select specific vector values depending on if the “UniqueParticleID” is 0 or 1, but of course as you can guess the more particles that spawn the sooner this prototype falls apart.

I can’t figure out a way to get these values for the Unique ID to be “Normalized” or even to get a consistent number out of them to use this masking method correctly.

If anyone has any pointers I would very much appreciate it!

Found the solution, I’ll post it here so if anyone else comes across a similar problem hopefully it can help.

I was able to take the “Particles : UniqueID” parameter and add 1 to it, then feed it into a modulo at 2% and check if the number is greater than zero, and use that boolean to select between the alternate numbered particle ID (in this case its odd and even since i’m only ever spawning two particles at a time).

This allows me to spawn two flipbook sprites from one emitter, while still being able to control the individual sprite alignment, as well as other stuff I control using Dynamic Material Parameters. Here I have one flipbook that is aligned to the floor and another that is aligned to the camera forward vector.

And having it be just able to handle the alternating ID, this emitter can be used to spawn thousands of these sets of particles at a time without having to work between two different emitters. Makes it very comfortable for spawning particles from a passive Niagara system in a pool.

1 Like