Strange webCamTexture and Resources Behavior

Hi All,

I have been trying to develop a portion of my program where players can use the webcam to take a picture which they can then later apply to an avatar. The attached code takes a still from the webCam, which is then converted to a texture and saved in Resources. This script works, but exhibits an odd behavior.

As an example, when you click on each pictures in the middle line of pics (cubes in a 5x5 grid), just as an example, you populate the cube textures and they show up appropriately as image captures from the webcam which is playing on the object this script is attached to. However, when you stop the program and replay the program (which reloads the folder where the images are stored in Resources), the cubes with textures that you had clicked on that should have the new textures are in different places, i.e. not all in the midline of the 5x5 grid. There seems to be a mismatch between what the cubes looked like when playing and when reloading the game. Any advice would be appreciated.

2239281–149349–CameraPicture.js (3.82 KB)

The cube names are numbers 0-25 like so btw.

0 1 2 3 4
5 6 7 8 9
… etc.