UI not updating

I am working on a game and need to display the players health via UI. I am getting an error message when I enter play mode though and the health does not update. The error message that I am getting says: “NullReferenceException: Object reference not set to an instance of an object”. What does this mean and how do I fix it?

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

public class ScoreUpdate : MonoBehaviour {
    public Text score;
    public int points;
    public int life;
    public Text lifecount;
    public Controls controls;
   
    // Use this for initialization
    void Start ()
    {
        //This is a separate script attacted to the player that contains the health variable for the player

        controls = GetComponent<Controls>();
    }
   
    // Update is called once per frame
    void Update ()
    {
        score.text = "Score: " + points.ToString();
        life = controls.health;
        lifecount.text = "Health: " + life.ToString();
    }
}

It means that one of the things you’re accessing (score, points, controls, life, or lifeCount) is null. If you look at the object in the Inspector, does each field have a value assigned? If not, you’ll get an error trying to access that non-existent component.

Is a “Controls” script on the same object as this ScoreUpdate script? If not, then your ‘controls’ property will be set to null in your Start() method. If you’re assigning Controls in the inspector, you probably don’t need that statement in your start method.