Play timeline inside loop

I have an array of static mesh components, for each object i need to move it from it’s current pos to another pos in 0.2 seconds, so i wanted to do something like a foreach loop and lerping the positions with a timeline, the thing is the loop doesn’t wait for the timeline to be finished but i need it to.

I have tried putting the timeline and the set relative location inside a custom event and then calling the event from the loop but it doesn’t work, i mean, i don’t see the components moving.

Because there is only one instance of your Timeline. You’re telling one time line multiple times to play from start.

The right solution would be this:

Replace everything after the foreach loop so it fits your needs.

Cheers!

worked like a charm, thank you very much. this was bugging me for days

Hey Azarus,

I know the post is a bit old, but I wanted to know, how could I add a delay in this setup so each objects use the same timeline but at a different frame ?

What I want to do is simple, I have 10 objects, I want them to move to a location at a different time.
I don’t want to create 10 timelines + 10 delays as I will have more objects later ( maybe 50 ).

Many thanks .

where is the picture oh god :frowning:

I know ! so close…

Put delay node inside of for loop and create new macro…

Try to set delay time with the equal time elapse in timeline



Also you can watch unreal engine trainings which Zac Perish teachs on youtube.

→ For loop with delay

Where has it gone? D:

Oh no, the picture!

Hi,Could any body give me a shortcut of solution? I got same problem.

Look at this answer for a picture of one way to resolve this issue: Play timeline inside ForEachLoop - Audio - Epic Developer Community Forums