Hi, Do you happen to have any suggestion?
I’m making a 2d match 3 style game and receive an error: CS0029 Line 19,17 Cannot implicitly convert type ‘int[,]’ to ‘int[ ]’
C#
using UnityEngine;
using System.Collections;
public class GridManager : MonoBehaviour
{
public int GridWidth;
public int GridHeight;
public int[ ] Grid;
public GameObject[ ] TilePrefabs;
void Awake ()
{
CreateGrid ();
}
void CreateGrid ()
{
Grid = new int[GridWidth, GridHeight];
for (int x = 0; x < GridWidth; x++)
{
int randomTile = Random.Range (0, TilePrefabs.Length);
Grid[x,y] = randomTile;
Instantantiate (TilePrefabs[randomTile], new Vector2 (x,y), Quaternion.identity);
}
}
}
Thanks, Melvin