Good Evening,
Can anyone help me out with this error: NullReferenceException: Object reference not set to an instance of an object. This error is pointing to line 34 on Manager.cs
Here is the Manager.cs
using UnityEngine;
public class Manager : MonoBehaviour {
// Player prefab
public GameObject player;
// Title
private GameObject title;
// Use this for initialization
void Start () {
// Search for the Title game object, and save it
title = GameObject.Find (“Title”);
}
// Update is called once per frame
void Update () {
// When not playing, check if the X key is being pressed
if (IsPlaying () == false && Input.GetKeyDown (KeyCode.X)) {
GameStart ();
}
}
void GameStart () {
// When it’s time to start the game, hide the title and make the player
title.SetActive (false);
Instantiate (player, player.transform.position, player.transform.rotation);
}
public void GameOver () {
// When the game ends, show the title
title.SetActive (true);
}
public bool IsPlaying () {
// Determine whether the game is being played by the visibility of the title
return title.activeSelf == false;
}
}