'RemoveAt' is not member of 'float[]';

Hi im new in Unity and doing some simple code by the Unity reference.
It said we can easy remove component of array by that method. But it occurs error.
Here is my code:

var location: float[];
function Start () {
location = new float[2];
location = [-882.5028, 360.8235];


You are confusing datatypes here. float is not the same as an Array() class! The unity wiki has a good reference for list types, their differences and the most important functions.

In specific, the type of list you want to use here is the Generic List.

var myFloatList : List.<float> = new List.<float>();

Easy mistake to make, Unity is referring to a class actually called ‘Array’, not the traditional .

var location: new Array();


It’s a javascript only class. ‘List’ is a good C# replacment. By the way you may wish to use the handy Vector2 struct for location.