Easy camera movement question

I’m sorry I keep looking at the video (3 of 8 of the roll-a-ball) and my code over and over for camera control but it says

“Can’t add script component ‘CameraController’ because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.”

I feel like it’s an easy thing but I keep checking and there’s no errors it tells me it just won’t let me add it in

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour
{

public GameObject player;

//set offset value. It's private because we can set that 
//value in the script (? kind of)
private Vector3 offset;

// Use this for initialization
void Start () 
{
	//these next few offsets are to stablize the transform distance
	//between player and camera so it always stays the same amount apart
	offset = transform.position - player.transform.position;
}

// Update is called once per frame
//LateUpdate runs every frame like "Update" but it's guarentee to run
//after all items have been processed in Update (? kind of)
void LateUpdate () 
{
	transform.position = player.transform.position + offset;
}

}

Thank you for dealing with me,
Patrick

When you created your script, you did not name it CameraController, as your script shows the the class name is “NewBehaviourScript”. You need to change the class name to “CameraController” and also rename the file as “CameraController” for the script to work.

Or copy the above code, then delete the “NewBehaviourScript” file and then create a new script and rename it to “CameraController” before you enter the scripting editor – and once in the scripting editor, then paste your code below the…

public class CameraController : MonoBehaviour {

When you created your script, you did not name it “CameraController”, as your script shows that the class name is “NewBehaviourScript”. You need to change the class name to “CameraController” and also rename the file as “CameraController” for the script to work.

Or copy the above code, then delete the “NewBehaviourScript” file and then create a new script and rename it to “CameraController” before you enter the scripting editor – and once in the scripting editor, then paste your code below the…

public class CameraController : MonoBehaviour {

Thank you! Helps a lot