[Niagara 5.0] Fix ribbon gap Mini Tutorial

Nice addition about the initial burst which I didn’t think of. Few things to point out:

  1. Spawn Burst already has the “Loop Count Limit” parameter so you don’t need to do that Emitter.LoopCount comparison.
  2. There is a simple trick to move the Particles.UniqueID check from Particle Update back to Particle Spawn when you cache Emitter.DistanceTraveled to the particle by setting the value for the initially burst particle with a ridiculously large negative value any value reasonably larger than your spawn spacing distance * -1, so the float comparison in Particle Update will always end up larger than the spacing distance, thus always pick the current Particles.Position.
  3. Float comparison of System.Age in place of int comparison of UniqueID would probably work as well, albeit with slightly poorer accuracy.
  4. I avoid naming the particles parameter (BirthDistance) which caches Emitter.DistanceTraveled with the same name, because Solve Forces module provides Particles.DistanceTraveled as well which is about the accumulated distance traveled of the particle itself, instead of the Niagara system actor. There is a pretty good chance that you may move your particles by physics which requires the Solve Forces module, so it is a good idea to not mix up the parameter names.

Edit: In hindsight, that ridiculous negative value didn’t make sense at all and could be detrimental.

3 Likes