NullReferenceException

Despite using the same code, the same error appears over and over again. I have read the comments related to the same error but they don’t offered a real solution


My first suggestion would be to restart Unity, just in case you haven’t tried that already.

You could try making the variable serialized and manually setting the TextMeshPro component in Unity’s inspector.

    [SerializeField] TextMeshPro label;

If that prevents the error, there’s a problem when getting the component through code.

Indeed, restarting Unity worked.

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

Privacy & Terms