Call Functions Across Scripts, Null Object Error

I am a total noob with unity and c# or please forgive me…

Ive got two assest I bought and I and trying to get them to talk to each other. 1) a sample completed game 2) a new ui

The error I am getting it “NullReferenceException: Object reference not set to an instance of an object” which i know means that it thinks I am calling a null.

Below is the UI Code trying to call Restart(); from LevelManager.cs

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

[ExecuteInEditMode()] 

public class PauseManager : MonoBehaviour {

public LevelManager levelManager;
public PlayerManager playerManager;
public GUIManager guiManager;
public AudioManager audioManager;
public CameraManager cameraManager;
// Lots of other code between... //

//Draw replay button
if(GUI.Button(new Rect(maxButtonRight  + Screen.width/8 - scaleWidth/2,Screen.height*4/10.0f,scaleWidth,scaleWidth),textures[1],"trans_button"))
			{
				isShow = false;
				//------------------------------
				//Do replay function in here
				//-----------------------------
				levelManager.Restart();
			}

// Lots of other code between... //

Below is the Restart(); method in LevelManager.cs

//This is the main function for the level restart mechanic
	public void Restart()
	{
		if (inRestart)
			return;
		
		inRestart = true;
		//timeManager.Restart();
		guiManager.Restart();
		cameraManager.Restart();
		
		gatheredCoins = 0;
		
		for (int i = 0; i < coins.Length; i++)
			coins*.SetActive(true);*
  •  for (int j = 0; j < lifts.Length; j++)*
    
  •  	lifts[j].Reset();*
    
  •  for (int k = 0; k < doors.Length; k++)*
    
  •  	doors[k].Restart();*
    

_ /* for (int n = 0; n < timeModifiers.Length; n++)_
_ timeModifiers[n].SetActive(true); */_

Ok I figured it out exactly after I posted this which drives me nuts since I was trying to figure this out for hours yesterday.

So if anyone runs into this here is what you need to do. You can’t just call the script in code like I was doing. You need to actually reference the object that has the script on it in Unity. So for the CameraManager what I did was in unity I selected the new scripts object. Then I draged the Camera object from the hierarchy in the “Camera Manager” slot in the new script.

Basically you have to find the game object that has the script on it and drag that game object into the references that you gave. My camera had the camera script on it, my player model had the player script etc. So I had to drag each game object into the proper field in the unity inspector for the new script.