A series of objects are following a spline with a certain separation from eachother, trying to seamlessly loop their motion

Hi all,

I currently have a chain of objects (stored in an array that goes into a foreach loop) that follow a closed spline, each at a certain distance from eachother. The motion is controlled by a looping timeline but when the objects reach the end of the spline, they first catch up with eacother at the last spline point and then repeat the next cycle along the spline as before. I would like to know how to make the motion continue seamlessly without them catching up or stopping before the next cycle begins. I’ve tried making it repeat when the objects current distance equals the total spline distance but it doesn’t make any difference, maybe because the motion here is based on a timeline that is set to loop.

I appreciate any help in advance. Any alternative method that will acheive the desired result will do too :slight_smile:

Right before setting SplineDistanceOfEnemyMesh, Mod the value with SplineLength. This will make the result relatively back to 0 if it becomes greater than SplineLength (due to the offset you are applying)

Thank you so much Ali! Worked like a charm!

Hi, I am trying to do the same and I’d like to know how you set the array and the timeline. I need instanced static meshes following themselves with a certain spacing but the second object starts only when the timeline ends (at the end of the spline path). I don’t get to see more than one object running on the spline at the same time.
Really appreciate any help.
Thanks

Hi. It works for me because I am using several static meshes and creating an array with each one of them. With an Instanced Static Mesh however, you need to get the instances and array them. So what I was looking at now as far as how to do that is in the screenshot. Haven’t tested it but it should work. You can then plug that “children” array into the foreach loop. As for the timeline, there’s nothing special about it, it just goes from 0to1 over a certain amount of time.

In the second pic you can see my final setup implementing the solution I got from Ali.

I hope that helps

Thank you so much Txeroki.