JS - Instantiation causes "index out of range" error

So I have gameObject A that instantiates several gameObjects from a properties array. One of the objects in that array, lets say game Object B instantiates several objects when it gets spawned. This causes a “index out of range” error on the gameObject A.

Any idea what would be causing this and how I could fix it?

You’re trying to refer to an array index that doesn’t exist. Like if you have an array called “myArray”, which has 4 items, and you say “myArray[4]”.

–Eric