B
B
Bragin Anton2021-12-07 17:40:57
Unity
Bragin Anton, 2021-12-07 17:40:57

Why is it throwing a NullReferenceException?

I wrote a script on the unit that if the variable is less than or equal to zero, then the text becomes invisible, and when vice versa, then it displays the text:
61af727128765275252389.png

When time_money_update is greater than zero, then it comes out:
61af71c9a57e6888353853.png

And when it is less than zero:
61af71ea5ca05365645439.png

I myself tried to figure out how to remove this error, but nothing failed
In addition:
61af7239ac81f877278782.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-12-07
@freeExec

So do another Debug.Log(<here_image_with_variable>) to make sure that the component with the text exists.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question