Hey there me again…
I am getting the error of
NullReferenceException: Object reference not set to an instance of an object. It says its in the GameManager line 20.
And then the same again on Line 26 but it spams this thousands of times!
due to the error none of the canvas gets enabled or disabled which ever it needs to do to.
public class GameManager : MonoBehaviour
{
Quiz quiz;
EndScreen endScreen;
void Awake()
{
quiz = FindObjectOfType<Quiz>();
endScreen = FindObjectOfType<EndScreen>();
}
void Start()
{
quiz.gameObject.SetActive(true);
endScreen.gameObject.SetActive(false);
}
void Update()
{
if(quiz.isComplete)
{
quiz.gameObject.SetActive(false);
endScreen.gameObject.SetActive(true);
endScreen.ShowFinalScore();
}
}
public void OnReplayLevel()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
public void OnQuitPressed()
{
Application.Quit();
}
}
i added my own Quit button i have tried removing this just in case it cause an issue but still getting it so nothing to do with that