- When I try to play my scene in Unity, an error appears saying all compiler errors must be fixed first.
- I don't know where to find the errors in my script.
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 need fixing.
|Please note: Unity will not let you play the scene until all compiler errors have been fixed.|
Double-click on the white text or go to the Window/Console (Ctrl+Shift+C in Windows).
The full Console should be visible. You may need to reset your layout first with Window/Layouts if you cannot find it.
Double-clicking on the error message details 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.
After 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.
See the article, 'Why do I get an "All compiler errors have to be fixed before you can enter playmode!" error?', for more information on why you cannot enter Play mode with existing compiler errors.