Miffed as to why Array index is out of range. Quick Question

if smokeCloudManagerData.smokeCloudLimit is > 0, can anyone think of a reason this code can read that Array index is out of range?

Thanks

	for(var scld : int = 0; scld < smokeCloudManagerData.smokeCloudLimit; scld++)
			{
				smokeCloud = smokeCloudManagerData.smokeCloudArray[scld];
}

You probably want to do

 for(var scld : int = 0; scld < smokeCloudManagerData.smokeCloudArray.lenght; scld++)
{
   smokeCloud = smokeCloudManagerData.smokeCloudArray[scld];
}

The only reason why this code would throw an index-out-of-range exception is if smokeCloudLimit is greater than smokeCloudArray.length.

Just fixed the minor typo for you. :slight_smile:

Right,
thanks guys.

I actually just popped in more members to the array, not a big deal memory wise and that seems to have done it. I think the members of the pool were just getting used up and the way I had written the code, caused the error.

Cheers.

!!!