Hello,
I am getting error in my script where I try to instantiate game object:
public int mapL, mapH;
public Transform[,] mapTransform;
void Start ()
{
mapL = 10;
mapH = 10;
mapTransform = new Transform[mapL,mapH];
Stuff();
}
void Stuff()
{
mapTransform[i,j]=Transform.Instantiate(grassButton, new Vector2(i,j), transform.rotation);
}
Cannot implicitly convert type UnityEngine.Object to UnityEngine.Transform. An explicit conversion exists (are you missing a cast?)
Same if I use public GameObject[,] mapTransform:
Cannot implicitly convert type UnityEngine.Object to UnityEngine.GameObject. An explicit conversion exists (are you missing a cast?)
Can anyone tell me what I am doing wrong?