Photon Player Name Script Error

Hi everyone,
I am building a WebGL Multiplayer Game that utilizes Photon PUN. I have a Player Name script set up, and attached to a UI so players can enter their name upon joining the game. When I test the game, the UI works up until I press the “join” button where I then receive a pesky NullReferenceException error. This is strange because there are no visible issues in the script when I open it in Visual Studio.
The error reads as follows :

NullReferenceException: Object reference not set to an instance of an object* *PlayerNameInput.SetUpInputField () (at Assets/PlayerNameInput.cs:23)* *PlayerNameInput.Start () (at Assets/PlayerNameInput.cs:15)* *

My Player Name script looks like this :

* *using UnityEngine;* *using UnityEngine.UI;* *using TMPro;* *using Photon.Pun;* *public class PlayerNameInput : MonoBehaviour* *{* *[SerializeField] private TMP_InputField nameInputField = null;* *[SerializeField] private Button continueButton = null;* *private const string PlayerPrefsNameKey = "PlayerName";* *private void Start() => SetUpInputField();* *private void SetUpInputField()* *{* *if (!PlayerPrefs.HasKey(PlayerPrefsNameKey)) { return; }* *string defaultName = PlayerPrefs.GetString(PlayerPrefsNameKey);* *nameInputField.text = defaultName;* *SetPlayerName(defaultName);* *}* *public void SetPlayerName(string name)* *{* *continueButton.interactable = !string.IsNullOrEmpty(name);* *}* *public void SavePlayerName()* *{* *string playerName = nameInputField.text;* *PhotonNetwork.NickName = playerName;* *PlayerPrefs.SetString(PlayerPrefsNameKey, playerName);* *}* *}* *

Can someone help me figure out what is causing this?
I can’t find anything in my other scripts that may be interfering with this one,
and I’ve already assigned the objects / interactions in the inspector. I’m not sure what else to do.

Why all of a sudden people start using PUN again?

PUN is deprecated. Please use a solution that is up-to-date and maintained, like Netcode for GameObjects, Fish-Net or Photon Fusion if you want to go with a Photon product.

That said, look at the line 23, one of these objects on that line is null. I’m guessing it may be nameInputField. Perhaps it’s not assigned in the inspector.

Thanks for the hasty response - I will look into Fusion.

There is nowhere in my inspector to assign that : (

It‘s a SerializeField. It should show up in the Inspector.