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.
- [URP] SubmitRenderRequest with NativeRenderPass + Upscaling doesn't work
- “ArgumentOutOfRangeException” error appears when inserting a double character if using “SetValueWithoutNotify” on UI Toolkit’s TextField
- Particle System emission delays between particle generations when playing the simulation
- EditorUtility.DisplayDialog is not shown when Input.GetMouseButtonDown is called a second time
- Animator Enum Properties get set to 0 instead of the value specified in the Scene when the Property is animated by a State that is not playing