Hi i am getting this error with the scoretext on the game over screen unsure how to fix it.
NullReferenceException: Object reference not set to an instance of an object
UIGameOver.Start () (at Assets/Scripts/UIGameOver.cs:18)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class UIGameOver : MonoBehaviour
{
[SerializeField] TextMeshProUGUI scoreText;
ScoreKeeper scoreKeeper;
void Awake()
{
scoreKeeper = FindObjectOfType<ScoreKeeper>();
}
void Start()
{
scoreText.text = "You Scored:\n" + scoreKeeper.GetScore();
}
}