I’m trying to spawn one strip per event (direct link send by script). The event has Start and End attribute for the ribon, and the particle has a lifetime so strips may overlaps. But I can only see one strip spawning, immediately replacing the previous one.
I think it has something to do with the strip index but how ?
Your assumption is correct. You need to set a unique Strip Index for each new Spawn Strip.
A simple way to set up this :
Strip Index = ParticleID / uint(ParticlePerStripCount) % StripCapacity
So the contrary to the Spawn Index, Particle Id is a unique ID which constantly increase with new particles being born.
By dividing this Number by the ParticleperStripCount (be sure to floor the result or divide by Uint) you’ll get an increasing StripIndex. Now, you don’t want this StripIndex to go above the StripCapacity. For this, you can use a Modulo operation.
I hope this explanation makes sense and that it allows you to get what you are looking for.
Sunny day to you.
Thanks, I came to a different solution by the time. I was trying to replace mine with yours but I was surprised to find out the modulo one does not work correctly in this situation. Sometime the strips are continuous, this does not happen with the fractional one.
3 nodes with modulo :
5 nodes with fractional:
Do you see something wrong ?
Well, It’s difficult to be sure based on your screenshots as I’m not sure why I’m seeing so many Strip Segments, when your graph screen implies that it should only burst 1 Strip.
With that being said, there might be some small mistakes (If I’m correct on what you’re trying to achieve):
- Your Set Progress attribute is made using the SpawnIndex. Now, let’s say you’re spawning 2 strips on a particular frame. Then your 0-1 value would be incorrect. I would suggest that you use the SpawnIndexInStrip instead:
StripProgress01 = SpawnIndexInStrip / float(ParticlePerStripCount - 1);
- You Random Generation to get the Start and EndPosition is based on a VFXComponent Seed
This means that you’ll get the same values if you spawn multiples strips.
I would suggest that you use a PerParticleStrip Seed instead.
The Modulo method should be working and is simpler. I’m joining a small unity package so that you can compare your VFX with mine and see what’s I cannot on your screenshots.
VFXG_MultipleStripIndex.unitypackage (6.6 KB)
Hope it helps.
I spawned multiple strips and they have lifetime, so they overlap, and then some appears to be continuous.
Yes the “spawn index” to get ratio was not helping but the main reason was the type of divide and modulo nodes that where both (float). Switched to (uint) and the strips are now all ok. I did not pay enough attention to these little.
thanks for help
by the way one last thing:
to set the ratio I do not use “spawn index in strip” but “particle index in strip”. Does it make a difference ?








