Stuck with online course. Please help.

hi im currently doing an online course with unity and im getting this error code

Assets/GameController.cs(11,36): error CS0266: Cannot implicitly convert type UnityEngine.Object' to UnityEngine.GameObject’. An explicit conversion exists (are you missing a cast?)

this is the code

void Start () {
for (int i = 0; i < 10; i++) {
GameObject cubeObject = Instantiate (cubePrefab);
cubeObject.transform.position = new Vector3 (
Random.Range(-10f, 10f),
Random.Range(-10f, 10f),

it all seems to work fine for the guy in the video. any help would be greatly appreciated. Thanks in advance.


GameObject cubeObject = Instantiate (cubePrefab) as GameObject;

Good Luck;