Array lenght

Hi folks!

I start with an array of gameobject, filled via editor.

Then I want to manage this array, or better, a copy of it to remove elements, I need to know what’s the size of the new array by I alway get null :(…

Here is my code:

var sourceTiles : GameObject[];

function Start () {

var tiles = new Array (sourceTiles);

print(tiles.Lenght);//i get null :(



//this is a simplyfication of the loop that I need to remove

for (var i : int = 0; i < tiles.Lenght; i++)
	tiles.RemoveAt(i);

}

Maybe I need to understand better how to use builtin array and jsarray…:frowning:

really thanks :slight_smile:

There is a spelling mistake in your code. ‘tiles.Lenght’ should be ‘tiles.Length’.