Is the sequence node broken and I need to avoid it? Because the For Each node doesn't work properly

So I have a blueprint node sequence with a couple of nodes out of it. And an array variable.

Lets say on sequence execution node 3 I add to this array 10 elements. Then on the same node I run “For Each” on this array and I print the index. It prints correctly from 0 to 9. Good

But now on the sequence execution node 4 I try the “For Each” again for this node. It doesn’t work, it prints only 0. not 0 to 9. Trying to get the length of the array on this sequence line returns the correct length of 9. so the array is fine.

Then I’ve tried the “For Loop” passing the array length (which returns 9) as Last Index. Nope it doesn’t work.

So the same setup works on sequence execution node 3 but not on sequence execution node 4. why? is this a bug?

Can someone confirm that it happens to them too?

If it helps I’ve create some of the sequence nodes using the “Insert Execution Node Before”

I’m really worried that maybe I should just create a long of line nodes instead just to be sure other stuff like this doesn’t happen when using sequences.

If you’re thinking these nodes don’t work properly, I’ll lay money that you have ‘latency’ someone in the blueprint ( like a delay node ).

You can’t hang delay nodes on loops or sequence nodes. The moment the system see latency, it just jumps straight to the next loop/sequence.

It does use the delay, but a delay won’t stop it moving to the next branch…

So the sequence is not actually a sequence? Meaning one after another?

If I decided to create a loop on a sequence execution line and it takes more time than some arbitrary number we don’t know what is, it will jump to the next execution node? BUT it will eventually complete the node that didn’t have the time to complete?

Is this how this works?

Is like some asynchronous nightmare. It messes all your blueprint logic like this.

so as long as the data/logic on one execution line is not used by other lines I should be fine I think. Actually no because it may mess the async load node. That is one other pesky node there

It’s quite straightforward.

You can hang as much on each pin of a sequence as you like. Including loops. But the moment you use a node that has latency

The system will put the chain of nodes to one side, and work on the next pin.

This is true at ANY time. Loops, sequences, anything. Latency will cause the rest of the chain of nodes to be picked up later, when the delay has finished.

And… sharing data between lines is a really bad idea. If you mean dragging pins from one chain into another chain…

That makes sense. I was setting variables in one sequence line then accessing them in another sequence line.

That’s fine, as long as you’re aware of the possible problems.

You see some code on here, and people make a variable in one area on the BP, and drag the pin about 50 miles to another part, and then wonder why they are getting ‘accessed none’ :slight_smile: