Animation Nodes : Use Previous output of a Loop in calculation of the next iteration What i am trying to achieve :


Random floating floors (square plane)
floating stairs connecting to each of them (Line generator with steps)
all floating floors have another floor which is parallel to it so the stairs are straight and  only going up or down


What i have achieved so far


Object instances get vertical elevation from index of loop
Random number to either or X or Y axis by using boolean switch


The problem :

all the planes are shifted from origin rather than using the location of the previous plane as starting point 

So, is there a a way for the loop to get the location of the previous plane and offset the next plane in X or Y ?



For the stairs I'm planning to use line generator in start/end/step mode in loop to generate locations for the stair instances
You can do this by using 'reassign'.

This is an option accessible from the 'loop subprogram' and which allow to obtain a node from which you can reassign an input parameter from some calculated result inside the subprogram.


Select the subprogram.
Go into the properties on the right, in the node tab, then click 'reassign' for the input you want.
That generates a reassign node, place it in the grid.




Now you can connect its input from the calculation you want (here probably the loop result).