Search Issue Tracker
Fixed in 2022.1.X
Fixed in 2019.1.X, 2020.3.X, 2021.1.X
Incorrect error dialog appears when trying to attach script with spaces in the file name
How to reproduce:
1. Create a new project
2. In the Project window create a new C# script and name it "test script" (with the space)
3. Try to drag the newly created script on the "Main Camera" GameObject
Expected result: An error dialog appears with the following message "Can't add script component 'test script' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match."
Actual result: An error dialog appears with the following message: "The script test script' does not contain a class derived from UnityEngine.MonoBehaviour"
Reproducible with: 2018.4.34f1, 2020.3.7f1, 2021.1.6f1, 2021.2.0a17
Not reproducible with: 2019.2.0a3, 2019.4.26f1
1. Reproducible on Windows 10 and Ubuntu 18.04
2. The issue was previously fixed in 2019.2.0a3 but regressed again
3. On 2020.2.0a1, 2020.2.0a8 the script can be attached but doesn't load
4. Messages on different Editor versions:
2018.4.34f1: Can' add script AssemblyInfo.cs. The script needs to derive from MonoBehaviour!
2020.3.7f1: The script don't inherit a native class that can manage a script.
2021.1.6f1, 2021.2.0a17: The script 'gg hh' does not contain a class derived from UnityEngine.MonoBehaviour
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [M1] Build fails when the project's name contains Mac terminal's command and the scripting backend is set to IL2CPP
- DrawMeshInstancedProcedural error and a lot of other Shader errors when the TerraWorld package is imported to a project
- ObjectDisposedException is thrown when resizing an array drawn in a custom editor
- Package Manager doesn't show packages under the "Custom" tab when the packages are referenced locally
- [Linux] Crash on d_print_comp_inner when opening "Karting Microgame" template project