Getting error on lesson 30 when I use Instantiate(ballPrefab);
UnassignedReferenceException: The variable ballPrefab of BallSpawner has not been assigned.
You probably need to assign the ballPrefab variable of the BallSpawner script in the inspector.
UnityEngine.Object.Instantiate[GameObject] (UnityEngine.GameObject original) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:202)
BallSpawner.Start () (at Assets/Scripts/BallSpawner.cs:12)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BallSpawner : MonoBehaviour {
public GameObject ballPrefab;
// Use this for initialization
void Start () {
//print(ballPrefab);
Instantiate(ballPrefab);
}
// Update is called once per frame
void Update () {
}
}