"so the layer index plus the result of the random give me one unique number" - yes, that is true and you'll get the same result just using the random in a range of 0,25. It's easier, less lines, more logic. However, none of those approches will prevent you from getting repeated postions, because 7.4566 and 7.1293 are two unique random numbers, but math.floor(random(...)) will make both of them to 7. Using Math.round() might be a better approach, but still not a bulletproof solution (7.64 and 8.001 will be both 8). This is a good example why expressions really should have global variables... My recommendation is to just shift the colors, not the squares, because you cannot easily prevent having double integers, as I stated above. When only shifting colors, however, you can prevent a visual "black hole" - instead you will only get same colors two times which is hard to notice anyways. One last glimps of hope is, that expressions might be evaluated layer by layer and not parallel for all layers. I'm not sure about this, but if AE is evaluating layerwise, you can check if another layer is already at the postion you want to set the current layer to. In this scenario, you need to know if AE evaluates from top to buttom of the layer stack, or buttom to top. Taking the second case, a layer could questioning: "I picked a random number and this turns out to a given position, is a layer below me already at this position? If yes, I pick another random number and ask again - if not, I take this position". *Martin
... View more