hey so ime making a script that loops through a bunch of items a bunch of times and each
item neads the some data stored so i set an array of clases but it seeams like i carnt set its length as when i accesses it it dosent apear to have any value and returns null anyway heres the array and class
`
public class Water{
public Vector2 curent = new Vector2 (0,0);
public float CapedDirt = 0f;
}
public void Erode (){
Water[] Drops;
float BlockErosionAmount = 0.05f;
float maxCaped = 0.5f;
Drops = new Water[1000];
for (int i = 0; i < MapSize*5; i++){
for (int w = 0; w < 1000; w++){
Vector2 start = new Vector2 (Random.Range(MapSize*0.25f,MapSize*0.75f),Random.Range(MapSize*0.25f,MapSize*0.75f));
print (Drops);
print (Drops[w].curent);
Drops[w].curent = start;// error coming from here
`
and hears the error its throwing at me
NullReferenceException: Object reference not set to an instance of an object
MapGenBrush.Erode () (at Assets/Standard Assets/MapGenBrush.cs:98)
MapGenBrush.CreateHeightMap () (at Assets/Standard Assets/MapGenBrush.cs:81)
MapGenBrush.Start () (at Assets/Standard Assets/MapGenBrush.cs:25)
thanks for any help ime asuming this is just my inexperience with c# as ime used to js