I stuck with lecture 25 Public Methos and Return Types

Sorry, this lecture so hard to me. I can google and understand a little knowledge. But it’s still too difficult for me. By the way, anyone can explain to me what’s the matter with my program?

I did everything follow the guide in the lecture,

code2

but there is something wrong here. :frowning:


HELP ME :frowning:

Hi @Real_Time_Action,

Does MonoBehaviour have the same colour as your classname? If not, there might be a problem with Visual Studio. Please watch lecture “Fixing Visual Studio Problems” (currently #4).

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.

Did this fix it?


See also:

Privacy & Terms