Follow

How do I interpret a compiler error?

Symptoms

  • When I try to play my scene in Unity it says all compiler errors must be fixed first.
  • I don't know where to find the errors in my script.

Cause

Compiler errors are generated by a script that has erroneous code. When you create a script in Unity and click play to test the script is working, you may receive some bright red error text in the collapsed version of the Console located in the bottom left corner of the Unity Editor:

The red text is the type of compiler error in your script. The white text with a red warning icon shows the specific compiler error details in your script that needs fixing.

Please note that Unity will not let you play the scene until all compiler errors have been fixed.

Resolution

Double-click on the white text or go to the Window/Console (Ctrl+Shift+C in Windows) the full console should be visible. If you cannot find it, you may need to reset your layout first with Window/Layouts.

By double clicking on the error message details, this triggers the script to open directly and it should even take you to the exact line where the error was generated so you can fix the error described. Once you have fixed the error, save the script and click on Unity. Unity will compile your changes and write any errors to the console. Continue to fix errors until there are none.

More Information

For more information on why you cannot enter playmode with existing compiler errors then see this article here

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.