Roll-A-Ball error

Hello.
I am starting a Roll-A-Ball and an error that says this come up no matter what. It is
The referenced script on this Behaviour (Game Object ‘Player’) is missing!
I have tried a lot if I could I have help that would be great. Script:
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour
{
public GameObject player;
private Vector3 offset;
void Start()
{
offset = transform.position - player.transform.position;
}
void LateUpdate()
{
transform.position = player.transform.position + offset;
}
}

I use Microsoft Studio C# 2015. Windows 10 Dell.

you most likely did not drag the player object to the script in the inspector.
you have a public GameObject player, but it’s never assigned to anything in the script.
the easy thing to do is to fix it in the inspector(unity). just drag and drop.

or you could right some code
void Start()
{
player = GameObject.FindWithTag(“Player”);

}

1 Like

i have had that problem before cant remember properly ,
i think johne5 is right.