Error

So… In unity I see three kind of error.

  1. The yellow triangle which say something like: “Bro you can make an improvement”;
  2. The red triangle witch is a compiler error;
    And the last one… I don’t know what is. So, What is with the last error? I can still Play my game and my game work good.

Care to share an example of actual messages you’re seeing?

My guess is that these are just log messages. Same as what you’d see if you ran Debug.Log(“Your message here”). They allow you to see when certain blocks of code execute and get values of properties at that time, and are a handy way to debug problematic code.

Yellow symbols mark warning messages. Typically these are messages that something is less than ideal and usually they will tell you specifically how to fix them. Occasionally you’ll get something stupid though like how the file has line endings for different platforms.

You can generate your own warning messages with Debug.LogWarning.

Right, and technically it’s the only error symbol. Just keep in mind that both the compiler and editor make use of these messages. Occasionally I get red messages for stupid things like starting Visual Studio when the project is using Script Inspector. If you hit the Clear button and the message goes away it’s the editor creating it from an action it performed.

You can generate your own error messages with Debug.LogError.

Everything that doesn’t fit in the yellow or red goes under this. You can generally treat them as success messages because they’re often informing you that something worked properly.

You can generate your own messages with Debug.Log.

I speak about this kind of error


ignore the game in background

As the error message tells you, there is a Null Reference Exception at line 33 of PlayerController.cs.

Check out that line in your script and see what could be causing it. If you don’t know what a Null Reference Exception is, now is a fantastic time to Google it and learn! Then look at your code and see how you may be causing that to occur and go from there.

This is all great practice in debugging your game and learning better coding practices in the process.

Thx, I will