
Since that won't work we can seed it with a unique number, derived from the comp's name. If you use the same seed the generator will always produce the same results, so usually on a layer you use the layer's index to set the seed. The seedRandom() function takes two arguments, the first being a number, which seeds the random number generator, and the second a boolean which set whether the random number generator changes with time or if it stays the same. It's more commonly used for the random() and gaussRandom() functions, but it works for wiggle() and noise() too.

This is the problem you're experiencing.įortunately there is a way of overriding the seed for the random number generator.

So you can see that the wiggle() function is deterministic, and produces the same results for the same layer index across different comps. I've offset each layer a little on the Y axis so you can see them all: Here I've duplicated the original comp three times and brought them into another comp. This means that if I duplicate my comp, each duplicate comp produces the same result. So ∴ the index of the layer is used to generate random values for the wiggle() function. You can also explicitly set the index of the layer generating the wiggle, e.g.: var i = math.floor(effect("Slider Control")("Slider"))

If I add layers to the comp before the shape layer, so that the shape layer's index changes this also changes the shape of the path. If I duplicate that layer in the same comp I get two different paths (I've given each a different colour, but the expression is the same): 5, t = i) ĬreatePath(points = newPath, inTangents =, outTangents =, isClosed = false) To demonstrate here's a comp with a shape layer where the vertices of the shape are generated by the wiggle() function:

The random number generator in AE seems to be linked to the layer index, but generates the same results for every composition.
