Couldn’t find much examples for For-Loops in Niagara. Here a simple Example where for each particle, I read the position of EVERY other particle (via for-loop) and draw a line. Can be useful for Plexus-VFX (e.g. [Niagara 5.1] Plexus Mini Tutorial)

Couldn’t find much examples for For-Loops in Niagara. Here a simple Example where for each particle, I read the position of EVERY other particle (via for-loop) and draw a line. Can be useful for Plexus-VFX (e.g. [Niagara 5.1] Plexus Mini Tutorial)

Oh my ! I’ve been trying to understand how to use the Map For node outside of simulation stage for years to be able to build some array based logic withing niagara scripts.
Thanks you so much for your findings @simonschreibt, a life savior as usual ![]()
If I understand correclty, any function that is plugged before the Map For in the script AND is connected in some way to the “Map For Index” node will be triggered several time ? Do I get this right ? ![]()
Glad to hear! I struggled with it too and couldn’t find much documentation about it. Then I stumbled across this post here where a screenshot shows a setup and it let me to experiment again: Niagara array for spawn particles - #4 by sarahlenker - FX - Epic Developer Community Forums
As far as I understand, everything is executed several times even without the Map For Index. This is just containing the current iteration number.
To add to this there’s this video by Tharle that I think sums up pretty well how the for loops work in Niagara