Search Issue Tracker
Won't Fix
Won't Fix in 2023.1.X
Votes
0
Found in
2021.3.18f1
2022.2.6f1
2023.1.0b3
Issue ID
UUM-26461
Regression
Yes
The script can be dragged and dropped before it is compiled
How to reproduce:
1. Create a new Unity project
2. Create a new C# script
3. Try to quickly drag and drop the script on any GameObject in the Hierarchy
Expected result: You are unable to drag and drop the script before it compiled
Actual: You are able to drag and drop the script on the GameObject before it is compiled and the “Can’t Add Script“ error window appears
Reproducible with: 2021.1.0a6, 2021.3.18f1, 2022.2.6f1, 2023.1.0b3
Not reproducible with: 2020.3.45f1, 2021.1.0a5
Note: Error message "Can't add script component 'NewBehaviourScript' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match" could be more specific or the drag and drop action could be unavailable
Comments (1)
-
RasBadyouthEntertainment
Nov 28, 2025 19:22
This occurs where there are other errors that haven't been fixed yet and can be overcome. Fixing all errors makes drag and drop of script possible.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
- Enabling “Editor Extension Authoring” in UI Builder doesn’t dirty the document and saving with shortcut doesn’t persist the state
- WebRequest.Create() function fails with "URI prefix is not recognized" errors when the project is built for Linux Standalone or Windows Dedicated Server
Resolution Note:
Unity needs compilation to be done before it can understand which .net classes have been built from the file. So we can't fix that.
Resolution Note (2023.1.X):
Unity needs compilation to be done before it can understand which .net classes have been built from the file. So we can't fix that.