Quantcast
Channel: Answers for "Texture2d[]: Array index is out of rang (Javascript)"
Browsing latest articles
Browse All 6 View Live

Answer by whydoidoit

If you want them to loop you should try calCharge[charge % calCharge.Length] (that's a modulus so its always inside the length of the array.

View Article



Answer by Eric5h5

Use [Array.Length][1] and make sure "charge" does not equal or exceed it. [1]: http://msdn.microsoft.com/en-us/library/system.array.length.aspx

View Article

Answer by OtsegoDoom

If you're getting the "Array index is out of range" error then your [charge] variable must be going over the Length of your calCharge array. You'll need to add some code to check that charge++; doesn't...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images