I
I
Ilya Smirnov2017-09-05 21:43:27
C++ / C#
Ilya Smirnov, 2017-09-05 21:43:27

How to solve NullReferenceException: Object reference not set to an instance of an object?

krDL38vsEXvL0r.png
the error occurs on line 14, help and preferably explain what caused the error)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2017-09-05
@Googoogoogoose

Your GameObject does not have a GameScript. Accordingly, GetComponent will return null, and you are trying to take countText from null (from nothing). Nothing can be taken from anything.
And yes - the code is TEXT.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question