Niagara : Increment Spline Index Per Particle

Hello, im trying to setup a niagara system that does the following :

  • Particles spawns at spline point index 0
  • A force attract the particle to the next spline point at index 1
  • When the particle reach a close distance around the attracting point of the spline, the spline index must change (for the particule) so it will be attracted to the spline index 2
  • when the particle reach the new target, the process continues.

I managed to do it by following a tutorial on youtube (kinda)…

It does the following ; Make a Vector Array from the Spline points, then with the Index of this Array, uses the location of the current point’s location vector to drive a “point force” to attract the particles, this point force location is changed in a Scratch pad, it sample the spline, get the index and remap it and increment between 0-1 (0 is the spline start point and 1 the spline end point)
The code is driving this value using the Particle Normalized Age..

This is an issue for me, as my particle have collision, and they bounce around when hitting a wall or even the player, this creates errors on the particle path because the collision forces them to take a longer path, therefore their individual age in increasing too much and they start targeting a spline point that is not in range, they simply end-up stuck in corners trying to target a point behind it.

I need a way to have the Index of the active spline point to be set for each particle, so if they hit and bounce on a wall, they will still continue their path to their current target and, only upon reaching it, start going to the next one.

I tried to set it in a scratch module, but i cant figure out how to make it work.

I would simply need to get the Spline Vector Arrays index (0) get the location of that point in the spline, and compare it with the current particle location, if it is close enough, increment the Spline index by 1 and so on…

Any help on how to achieve that ?