Unity Issue Tracker - The script can be dragged and dropped before it is compiled
Closed
UUM-26461
The script can be dragged and dropped before it is compiled
Unity: Scripting
Won't Fix
2023.1.X
2022.2.X
2021.3.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.
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
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
Prioritise and Follow this issue
Have a workaround or additional info about this issue?