Issue with creating biomes

Hi, I am making an alteration of Sebastian Lague’s procedural generation code so that it makes biomes. Although, I get CS0266 for the Cord values in these lines

    float BiomeLacunarity = noiseMap[**Cord.x, Cord.y**];

The cord values are vector2 but it says that the noisemap is an int. i tis not though ass shown in decleration:

**float[,]** noiseMap;

From what your post states, seems like you are doing something like this?

Vector2 position = new Vector2(0, 0);
float BiomeLacunarity = noiseMap[position.x, position.y];

This will NOT work and will throw CS0266 .

The reason is that the x and y properties of a Vector2 are floats, but the noiseMap indices are ints.

You can cast the Vector2 x and y:

Vector2 position = new Vector2(0, 0);
float BiomeLacunarity = noiseMap[(int)position.x, (int)position.y];

or you can use a Vector2Int

Vector2Int position = new Vector2Int(0, 0);
float BiomeLacunarity = noiseMap[position.x, position.y];