Exported code fails because of limit of 40000 elements?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By oli1980

I’m looping through pixels in a image and storing the pixel info in a Color[] in C#. The array is initialized for the full image, like this: new Color[(int)viewport.x*(int)viewport.y];

The code works fine in C# but the exported HTML/JS code gives me a error:

System.IndexOutOfRangeException: Index was outside the bounds of the array.

This occurs when checking the element at index 40000…so there’s some kind of limit in the JS version of the engine that the C# one doesn’t have?

edit: I managed to get my array size down and now the export works, but still curious about this