I got an null Error and no idea how to fix

NullReferenceException: Object reference not set to an instance of an object
UIGameOver.Start () (at Assets/Scripts/UIGameOver.cs:18)

{

[SerializeField] TextMeshProUGUI scoreText;

ScoreKeeper scoreKeeper;

void Awake()

{

    scoreKeeper = FindObjectOfType<ScoreKeeper>();

}

void Start()

{  

    scoreText.text = "You Scored:\n" + scoreKeeper.GetCurrentScore();

}

}

2 Likes

Nevermind i found the solution , I didn’t have scorekeeper on Scene :laughing:

4 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms