Why use Sequence node?

A sequence node makes sure that a series of instructions occurs in a certain order. Correct me if I’m wrong, but doesn’t that happen normally? And if so, what’s the benefit/detriment of using a Sequence node? Is it just organizational?

Yes its Organizational. There is one thing to keep in mind though. It works like separate Instructions. Example: https://i.imgur.com/6R6jzlp.png

The output you will get is: first, third, second

Aside from that there is nothing special about it.

1 Like

Got it. So the second branch begins prior to the delay?

Yes. Without the sequence node the delay would block the flow (or any other latent function). That way everything will still execute in the order specified but won´t wait for latent functions to proceed. But its very unusuall to use the node like that. Its just a edge case to keep in mind :stuck_out_tongue_winking_eye:

Gotcha. Thanks!

The reason this node exist is because you can’t connect 1 exec output to 2 or more inputs because it impossibe to reliably control execution order, you need to define order of things and this node alows you to do so.

Other reason to use it is ability to create a sequence of node that breaks and code can continue from the sequence. If you do normal chain of nodes once code execution breaks (for example failed Branch or Cast) it’s over, function ends (technically events are also functions), sequence allows you to continue execution from different point once something breaks on one end

Are there cases where order is not reliable if you execute one Node/Function after another?

The second one is actually a good reason to use it but not necesserly required since you always get other Exec Outputs true/false or Cast Failed/succed.

I cant really think of a case were a Sequence Node would be required (Except the Latent Action Edge case I noted in my Answer). A Completly different Story if they would return some sort of state (Think of BT Sequence as example)

I mostly use it to line up several heavily branching parts of code so I know that in every case of the first exec paths the later exec paths will always start.

is there a way to separate each exec from triggering until clicked again?
i.e. click button 1st exec runs, click button 2nd exec runs etc?

Use a switch with int for that. Click, int++, switch.

Fact that you got nodes diffrent outcomes is exacly reason why in 2nd case is required. On 1st, the unreliably of order is reason why you need to use sequence for what you described as “organizational” reasons in first place, you can not brach exec pin from output without help of other node… or Sequence node ;]