The following thing is an anti-pattern in Remotion:
While this will work during preview, it will break while rendering. The reason is that Remotion is spinning up multiple instances of the webpage to render frames in parallel, and the random values will be different on every instance.
random() API from Remotion to get deterministic pseudorandom values. Pass in a seed (number or string) and as long as the seed is the same, the return value will be the same.
Now the random values will be the same on all threads.
Did you get an ESLint warning when using
Math.random(), but you are fully aware of the circumstances described above? Use
random(null) to get a true random value without getting a warning.