# Geo Nodes: randomly rotate individual instances in double array?

I have a simple double array made with mesh line and instances on points and i want to rotate each block individually, but it seems it is only rotating the Mesh lines instead. For example, look at how along the 2nd array all rotations are equal, because the random value is only affecting the 1st array.

I've tried adding a Rotate Instances node, but it's rotating everything along the 2nd axis. Adding a random value to the 2nd array presents the same problem (except it rotates each line individually, but still not each cube)

So far adding the random value to the first array has given me the closest result to what i want. But i can't come up with the real solution, Thanks in advance! -Albert

• Do you need the double array, or could you use a Grid, to save a few nodes? Commented Dec 31, 2022 at 12:59
• @RobinBetts Thank you! This worked exactly how i wanted after adding a random value to rotation, as it treats each instance individually. Tbh I didn't even know Grid node existed so thank you again for that. If you want to add this comment as an Answer then I'll mark it as correct Commented Dec 31, 2022 at 13:14

Not exactly an answer to your question, but it turns out that in your case, you can simplify the tree by using a Mesh Primitive > Grid, (or maybe even two of them) instead of constructing a 2D array by hand:

• @vklidu Doooohhh! I seem to have developed a bad habit, and gone Instance-on-Points blind! I only popped this one in because OP asked me to, and to close it out.. I'll correct it when I can. Commented Dec 31, 2022 at 19:44
• Not necessary ... I was curious what I missed here. "See" you at incoming New Year (3 hours lefts) ... Commented Dec 31, 2022 at 20:10
• @vklidu You too! Have a very good one! Commented Dec 31, 2022 at 20:44

It is actually possible to achieve exactly what you wanted.

You need to realize your instances and get geometric center of elements by scaling them to zero and then merge them to one point per element/island (or you can get them another way, you just need exactly one point per each element). Then rotate them along the pivots using vector rotate and set position nodes. See this group:

Finally, to get your random rotation per object, group random values by island index like this:

Here is complete GN setup: