Loop function

I’m just trying to learn about loop function. I want to print every sec and stop at 20. What am i doing wrong?

I made the same mistake, but BP doesn’t work like that. Basically everything that can fire will fire, all at once. So the BP will fire a instances of that loop in one go. The delay is there, but you basically have a big list which is 20 delay nodes followed by print strings.

The end result is one delay followed immediately by the strings with no delay.

Here are several ways of doing what you want to do:

  1. Make yourself a while with a delay:

which inside, looks like this:

Or, use a timer:

Of course if you weren’t using a delay, it would be much easier :slight_smile:

296963-easy.png

How did you make that line from delay to loop to look that way? Mine overlaps

Just double click on the line…

Never knew it. It works. Thank you very much.

My bad. Its not working the way i want :)). the moment when i start it just print all 20 messages and ignore the delay.

296964-loop2.png

I dont know if I was fully understood but i want to print 1 wait 1sec and then print 2 wait 1sec and so on.

Did you do it like this:

Can you put it on a begin play, to take the overlap out of the equation.

Overlaps are not neat things, it could easily be firing many times…

Scratch that, I see it… you’ve still got a loop in there, you need an IF statement :slight_smile:

( I think my example No1 is incorrect… - didn’t test it ).

Where should i place my if statement?

You have it instead of the while statement. See just above here…

Aaah, you are right. Thanks alot!