Object reference not set to an instance of an object in c#

I was following the Burgzergarcade tutrial for the past month or so. I was learning java 1 week and unity the next, and I came across this weird error that other people seem to have. I read through the comments of the video (tutorial 28), and a lo of people posted fixes which I tried but they didn’t work. I’m using unity 3d 4.1.2. ps sorry for my English!

the error points at this lines: 72, 54, and 47

_toon.Name = GUI.TextField(new Rect(65, 10, 120, 25), _toon.Name);
and

DisplayName();

and

_toon.StatUpdate();

It happened after I added this line:

_toon = pc.GetComponent();

and removed these Lines:

_toon.Awake();

and

_toon = new PlayerCharacter();

using UnityEngine;
using System.Collections;
using System;

public class CharacterGenerator : MonoBehaviour {
	private PlayerCharacter _toon;
	private const int STARTING_POINTS= 350;
	private const int MIN_STARTING_ATTRIBUTE_VALUE = 10;
	private const int STARTING_VALUE = 50;
	private int pointsLeft;
	
	private const int OFFSET = 5;
	private const int LINE_HEIGHT = 20;
	
	private const int STAT_LABEL_WIDTH = 100;
	private const int BASEVALUE_LABEL_WIDTH = 30;
	private const int BUTTON_WIDTH = 20;
	private const int BUTTON_HEIGHT = 20;
	
	private int statStartingPos = 40;
	
	
	public GUISkin mySkin;
	
	public GameObject playerPrefab;
	
	// Use this for initialization
	void Start() {
		GameObject pc = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity) as GameObject;
		
		pc.name = "pc";
		
	//	_toon = new PlayerCharacter();
		_toon = pc.GetComponent<PlayerCharacter>();
	//	_toon.Awake();
		pointsLeft = STARTING_POINTS;
		for(int cnt = 0; cnt < Enum.GetValues(typeof(VitalName)).Length; cnt++)
		{
			_toon.GetPrimaryAttribute(cnt).BaseValue = STARTING_VALUE;
			pointsLeft -=(STARTING_VALUE - MIN_STARTING_ATTRIBUTE_VALUE);
		}
			
	}
	
	// Update is called once per frame
	void Update () {
		_toon.StatUpdate();
	}
	
	void OnGUI()
	{
		GUI.skin = mySkin;
		
		DisplayName();
		DisplayPointsLeft();
		DisplayAttributes();
		
		GUI.skin = null;
		
		DisplayVitals();
		
		GUI.skin = mySkin;
		
		DisplaySkills();
		
		DisplayCreateButton();
	}
	
	private void DisplayName()
	{
		GUI.Label(new Rect(10, 10, 50,  25), "Name:" );	
		_toon.Name = GUI.TextField(new Rect(65, 10, 120, 25), _toon.Name);
			
	}
	
	private void DisplayAttributes()
	{
		for(int cnt = 0; cnt < Enum.GetValues(typeof(AttributeName)).Length; cnt++)
		{
			GUI.Label(new Rect(OFFSET, 						//x
				statStartingPos + (cnt * LINE_HEIGHT),		//y
				STAT_LABEL_WIDTH, 							//width
				LINE_HEIGHT), 								//height
				((AttributeName)cnt).ToString() );
			
			GUI.Label(new Rect(STAT_LABEL_WIDTH + OFFSET, 	//x
				statStartingPos + (cnt * LINE_HEIGHT),		//y
				BASEVALUE_LABEL_WIDTH,						//width
				LINE_HEIGHT), 								//height
				_toon.GetPrimaryAttribute(cnt).AdjustedBaseValue.ToString() );
			
			if(GUI.Button(new Rect(OFFSET + STAT_LABEL_WIDTH + BASEVALUE_LABEL_WIDTH, 	//x
				statStartingPos + (cnt * BUTTON_HEIGHT), 								//y
				BUTTON_WIDTH, 															//width
				BUTTON_HEIGHT),															//height
				"-"))
				
			{	
				if(_toon.GetPrimaryAttribute(cnt).BaseValue > MIN_STARTING_ATTRIBUTE_VALUE)
				{
					_toon.GetPrimaryAttribute(cnt).BaseValue--;
					pointsLeft++;
					 
				}
					
			}
			
			if(GUI.Button(new Rect(OFFSET + STAT_LABEL_WIDTH + BASEVALUE_LABEL_WIDTH + BUTTON_WIDTH,		//x
				statStartingPos + (cnt * BUTTON_HEIGHT), 													//y
				BUTTON_WIDTH,																				//width
				BUTTON_HEIGHT),																				//height
				"+"))
				
			{
				if(pointsLeft > 0)
				{
					_toon.GetPrimaryAttribute(cnt).BaseValue++;
					pointsLeft--;
					
				}
			}
		}
	}
	
	private void DisplayVitals()
	{
			for(int cnt = 0; cnt < Enum.GetValues(typeof(VitalName)).Length; cnt++)
		{
			GUI.Label(new Rect(OFFSET, 											//x
				statStartingPos + ((cnt + 7) * LINE_HEIGHT),					//y	
				STAT_LABEL_WIDTH, 												//width					
				LINE_HEIGHT), 													//height						
				((VitalName)cnt).ToString() );
			
			GUI.Label(new Rect(OFFSET + STAT_LABEL_WIDTH, 						//x
				statStartingPos + ((cnt + 7) * LINE_HEIGHT),					//y
				BASEVALUE_LABEL_WIDTH, 											//width
				LINE_HEIGHT),													//height
				_toon.GetVital(cnt).AdjustedBaseValue.ToString() );
			
		}
	}
	
	private void DisplaySkills()
	{
				for(int cnt = 0; cnt < Enum.GetValues(typeof(SkillName)).Length; cnt++)
		{
			GUI.Label(new Rect(OFFSET + STAT_LABEL_WIDTH + BASEVALUE_LABEL_WIDTH + BUTTON_WIDTH * 2 + OFFSET * 2,						//x
				statStartingPos + (cnt * LINE_HEIGHT),																					//y
				STAT_LABEL_WIDTH, 																										//width
				LINE_HEIGHT), 																											//height
				((SkillName)cnt).ToString() );
			
			GUI.Label(new Rect(OFFSET + STAT_LABEL_WIDTH + BASEVALUE_LABEL_WIDTH + BUTTON_WIDTH * 2 + OFFSET * 2 + STAT_LABEL_WIDTH, 	//x
				statStartingPos + (cnt * LINE_HEIGHT),																					//y
				BASEVALUE_LABEL_WIDTH, 																									//width
				LINE_HEIGHT), 																											//height
				_toon.GetSkill(cnt).AdjustedBaseValue.ToString() );
			
		}
	}
	
	private void DisplayPointsLeft()
	{
		GUI.Label(new Rect(250, 10, 100,  25), "Points Left: " + pointsLeft.ToString());	
	}
	
	private void DisplayCreateButton()
	{
		GUI.Button(new Rect(Screen.width / 2 - 50, 									//x
							statStartingPos + (8 * LINE_HEIGHT),			//y
							100, 										//width
							LINE_HEIGHT 											//height
				 		), "Create");	
	}
}

it seems your instantiated object in line 29 doesn’t has a component(script) “PlayerCharacter” and you want access to some function in that script.
check whether your prefab has a component of type “PlayerCharacter” or not?

You’re over thinking it. Did you add the Player Character Prefab to your camera object?
I had this problem to, but in the camera object you should see a player prefab and next to it it says none. Add your prefab to it.