Game doesn't detect assigned GameObject Reference

I’m new to scripting and I learned a bit with the help of ChatGPT, but I can’t figure out why my script doesn’t work. I’m making a rock paper scissors game with floating objects that attack eachother, and I made a GUI scale option, but when I hit play, I get this error repeating again and again:

NullReferenceException: Object reference not set to an instance of an object
menuVals.Update () (at Assets/Scripts/menuVals.cs:68)

I don’t know what’s wrong, the references are assigned via the editor, and even if I use GameObject.Find instead of the variables, it still doesn’t detect it.

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

public class menuVals : MonoBehaviour
{
    public GameObject rockSlider;
    public GameObject paperSlider;
    public GameObject scissorsSlider;

    public GameObject rockText;
    public GameObject paperText;
    public GameObject scissorsText;

    public GameObject GOBJrockEnabled;
    public GameObject GOBJpaperEnabled;
    public GameObject GOBJscissorsEnabled;

    public GameObject uiCanvas;
    public GameObject guiScaleOBJ;
   
    public bool rocksEnabled;
    public bool papersEnabled;
    public bool scissorsEnabled;

    private int rocksVal;
    private int papersVal;
    private int scissorsVal;

    public int guiScale;
    public int enabledTotal;

    private float rawRocksVal, rawPapersVal, rawScissorsVal;

    // Start is called before the first frame update
    void Start()
    {
        GOBJrockEnabled.GetComponent<Toggle>().isOn = PlayerPrefs.GetInt("RocksEnabled", 0) == 1;
        GOBJpaperEnabled.GetComponent<Toggle>().isOn = PlayerPrefs.GetInt("PapersEnabled", 0) == 1;
        GOBJscissorsEnabled.GetComponent<Toggle>().isOn = PlayerPrefs.GetInt("ScissorsEnabled", 0) == 1;

        rockSlider.GetComponent<Scrollbar>().value = (PlayerPrefs.GetFloat("Rocks", 0.0f));
        paperSlider.GetComponent<Scrollbar>().value = (PlayerPrefs.GetFloat("Papers", 0.0f));
        scissorsSlider.GetComponent<Scrollbar>().value = (PlayerPrefs.GetFloat("Scissors", 0.0f));
    }

    // Update is called once per frame
    void Update()
    {
        enabledTotal = 0;

        rocksEnabled = GOBJrockEnabled.GetComponent<Toggle>().isOn;
        papersEnabled = GOBJpaperEnabled.GetComponent<Toggle>().isOn;
        scissorsEnabled = GOBJscissorsEnabled.GetComponent<Toggle>().isOn;
       
        if (rocksEnabled == true) {
            enabledTotal++;
        }
        if (papersEnabled == true) {
            enabledTotal++;
        }
        if (scissorsEnabled == true) {
            enabledTotal++;
        }

        guiScale = guiScaleOBJ.GetComponent<Dropdown>().value;
        uiCanvas.GetComponent<CanvasScaler>().scaleFactor = guiScale;

        rawRocksVal = rockSlider.GetComponent<Scrollbar>().value;
        rawPapersVal = paperSlider.GetComponent<Scrollbar>().value;
        rawScissorsVal = scissorsSlider.GetComponent<Scrollbar>().value;

        rocksVal = (int)(rawRocksVal * 124 + 1);
        papersVal = (int)(rawPapersVal * 124 + 1);
        scissorsVal = (int)(rawScissorsVal * 124 + 1);

        rockText.GetComponent<TextMeshProUGUI>().text = rocksVal.ToString();
        paperText.GetComponent<TextMeshProUGUI>().text = papersVal.ToString();
        scissorsText.GetComponent<TextMeshProUGUI>().text = scissorsVal.ToString();

        PlayerPrefs.SetInt("RocksEnabled", rocksEnabled ? 1 : 0);
        PlayerPrefs.SetInt("PapersEnabled", papersEnabled ? 1 : 0);
        PlayerPrefs.SetInt("ScissorsEnabled", scissorsEnabled ? 1 : 0);

        PlayerPrefs.SetFloat("Rocks", rawRocksVal);
        PlayerPrefs.SetFloat("Papers", rawPapersVal);
        PlayerPrefs.SetFloat("Scissors", rawScissorsVal);
    }
}

Very simple: either guiScaleOBJ is not assigned in the inspector OR it does not have a Dropdown component on it. Do note that if you’re using TextMeshPro (as all projects are doing by default in modern versions of Unity), you likely have a TMP_Dropdown instead of a Dropdown component.

You can also make your life 50% simpler by directly making references to the components instead of this extremely ugly use of GetComponent all over the place. For example. Instead of:
public GameObject GOBJrockEnabled;andGOBJrockEnabled.GetComponent<Toggle>().isOn = PlayerPrefs.GetInt("RocksEnabled", 0) == 1;
You can just dopublic Toggle RockEnabledToggle;andRockEnabledToggle.isOn = PlayerPrefs.GetInt("RocksEnabled", 0) == 1;
This skips a bunch of unecessary gcode and also guarantees that the object will not be missing the component you are looking for since you can only assign it in the inspector when it actually has that component. There’s rarely a good reason to use a GameObject reference instead of a direct component reference in Unity. So in this case I would suggest using:
public TMP_Dropdown guiScaleDropdown; and assigning that in the inspector directly.

And you can make it simpler another 50%:

Turn this liberal sprinkling:

into a much cleaner access:

Here’s an example of simple persistent loading/saving values using PlayerPrefs:

Useful for a relatively small number of simple values.

Thanks for the help! And also, thanks for letting me know that I can do that to variables.