NullReferenceExc

I double checked everything and I’m not sure where I went wrong. I’m getting NullReferenceException: Object reference not set to an instance of an object. error when I play the game.
Also I’m getting
Field ‘numberWizard.guessText’ is never assigned to…
Warning. What is this? What do I do?

Hi @Zizima,

Welcome to our community! :slight_smile:

NullReferenceException means that a reference (“link”) to an instance is missing. Double click on the error message to see to which line in your code it is referring. If you exposed a field in the Inspector, make sure that it’s not empty.

Those messages with the yellow icons are harmless warnings, probably caused by a bug in Unity. Double click on each message in your Console, and add = default; behind the respective variable declaration.

Did this help you fix the issue(s)?


See also:

1 Like

Thank you so so much, this was very helpful :heart::heart::heart:
Actually you guided me to the right direction, my script was still attached to the main camera and when I dubbled click on the error it lit up for a second!

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

Privacy & Terms