using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour
{
public GameObject aaa;
public GameObject[] aa = new GameObject[5];
public Vector3[] haha = new Vector3[]
{
new Vector3(0,0,0),
new Vector3(1,0,0),
new Vector3(2,0,0),
new Vector3(4,0,0)
};
void Start ()
{
for(int i = 0; i < 4; i++)
aa _= Instantiate(aaa, haha*, transform.rotation);*_
_*}*_
_*}*_
_*```*_
_*<p>Unity told me that :</p>*_
_*<blockquote>*_
_*<p>Assets/NewBehaviourScript.cs(13,25): error CS0266: Cannot implicitly convert type "UnityEngine.Object" to "UnityEngine.GameObject". An explicit conversion exists (are you missing a cast?)</p>*_
_*</blockquote>*_
_*<p>I don't know what to do*_
_*&=(</p>*_
The function `Instantiate` returns an `Object`. So your code for instantiating should be:
aa_=Instantiate(aaa,haha*,transform.rotation) as GameObject;*_
_*```*_
_*<p>or </p>*_
_*```*_
<em><em>aa_=(GameObject)Instantiate(aaa,haha*,transform.rotation);*_</em></em>
<em><em>_*```*_</em></em>
<em><em>_*<p>I like the first way better, but they are both the same</p>*_</em></em>