Niagara: identify first particle emitted per SpawnGroup

Hi! :slight_smile: I have an emitter with both a sprite and a ribbon renderer. Every now and again, the SpawnGroup particle attribute increments— this is driven by a SpawnGroup emitter attribute and a Data Channel read, reacting to events in the game.

I would like to set the VisibilityTag attribute of each different SpawnGroup’s first particle to 0, and to 1 for the rest of particles. Since the sprite renderer’s Render Visibility is set to 0, this should result in only the first particle of each SpawnGroup being rendered as both a sprite and a ribbon, and the rest only contributing to the ribbon.

I’ve spent many hours bumping into walls with this— my intuition tells me that it should involve something like comparing the previous SpawnGroup to the current one, but ‘previous’ attributes only get properly evaluated in Update stages, and this VisibilityTag should be set at the Particle Spawn stage… I have also tried to drive it by an emitter attribute calculated in the Emitter Update stage following the same principle, but the result is hit and miss, as there’s no guarantee that a particle will be spawned for each emitter update cycle…

I should probably mention that the way I’m spawning particles is with the Spawn Rate module, so I’ve also tried leveraging the HasSpawnedThisFrame output (module) attribute, but haven’t got anywhere with it. Any suggestion is welcome.

Thanks in advance!