[procedural content] rotation of multiple instances

Hi there,

I have set up a construction script to spawn multiple instances of an object with a random rotation value, this works fine. However, they all have the same rotation value. So I added a second FOR loop with a copy of the script so it essentially chains two of the objects in sequence, as the first FOR loop looks at index 1, second one looks at index 2 etc. I thought this would mean it would work through and spawn the first one at a random location, rotate it randomly and then move onto the next object and do the same. Instead what it does is apply the same rotation to all the objects - so it’s no different!

I’m thinking I have to make each instance of the object unique in some way and store the info and check against it later when it spawns instance 2, and 3 and 4 etc so each rotation and location is random and different to the preceding one - but I can’t do it.
I have tried but as I am new to this I don’t have the knowledge. I have tried searching but not found an answer to this problem.

http://s30.postimg.org/7ghoau6sh/FOR.png

I solved it by adding a Return Value (set a new variable) on the creation. Not sure why this doesn’t get overwritten everytime it goes through the loop? It works though. They now all spawn and have random location and Rotation unique per instance,

http://s21.postimg.org/8hx29hojb/for2.png