Download

move many instances, unsynchronised, with an unique timeline

Hello all.

It’s been a few weeks since I decided to learn the UE4 and to try to realize a first and modest game project.

Today, for the first time, I encounter a true difficulty that I cannot resolve on my own, nor with the help of the many tutorials and topics found on the net (French and English). (yes i’m french… so sorry for my bad english)
So I hope that someone can enlighten me from their experience.

So here’s the situation, quite simple on paper:
I want to trigger, at the start of a level (connection to an eventbeginplay), the movements of a multitude of instances of the same static mesh, but unsynchronized.
The movement is very simple and corresponds to the modification of the altitude of each of these instances with simple movement along Z axis (X and Y locked).

Obviously, if we forget the desire to desynchronize the triggering of these movements for each instance, making such an animation is not a problem for me. Likewise, if i wanted to trigger these movements in a loop, instance after instance, that would not pose a problem either.

However, the result I want to reach is to trigger those movements of these instances neither simultaneously, nor one after the other, but a bit like the takeoff of several randomly triggered rockets within a specified time range.
Thus, i wanna be able to launch a second rocket (so, set a second movement) while the first is still in progress. And this for a certain number of rockets (several tens).

I understand, now that I know the node timeline a little better, that it is just impossible to use a single one timeline node to animate several instances of my mesh in desynchronization since launching a new animation will immediately cut the output flow of the animation already playing. It seems to be obiged to wait for each animation to be completed to trigger a new one …

My final question is the following: Am I obliged to create the same adapted code as many times as necessary for each of my instances (96 at the moment o_O ') or is there a function or a technique which allows me to achieve the equivalent of a timeline but who would send an independent stream each time you ask for an additional instance ?

Certainly, a copious request for reading, but I try to be clear enough not to waste your time having to decipher the request … but it may not yet be won

Anyway, thank you for the time you can give me on this topic.
And happy new year to all.

If you are already using a timeline to move the instances, you can use the same setup, but also have an array of the ‘syncronization offsets’. It’s just a float array.

Then, on the execute pin of the timeline you can use a foreach loop to move the Z coord of the instances ( using the offset array ).

Tell me if you need more info ( also maybe show your current timeline code ).

It’s very ‘procedural’ though, this method. There a more subtle method that involves spawning empty actors with timelines to control the rockets.