Search Issue Tracker
By Design
Votes
0
Found in
2022.2.12f1
2023.1.0b10
2023.2.0a8
Issue ID
UUM-31850
Regression
Yes
Script Component is treated as an Editor script when attaching to GameObject and when there are two partial classes with the same name and file name in the project
Reproduction steps:
1. Open the attached "repro_IN-36142WrongMessage.zip" project
2. Open the "Assets/Scenes/SampleScene" Scene
3. In the Hierarchy window, select the "TestObject" GameObject
4. In the Project window, drag and drop the "Assets/FirstPartClass" script to the Inspector window
5. Observe the error message
Expected result: The error message shows "Can't add script component 'FirstPartClass' because the script class cannot be found..."
Actual result: The error message shows "The script is an editor script."
Reproducible with: 2022.2.9f1, 2022.2.13f1, 2023.1.0b10, 2023.2.0a8
Not reproducible with: 2022.2.8f1
Could not test with: 2020.2.46f1, 2021.3.22f1 (There is no error message)
Reproduced on: Windows 10
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Resolution Note:
This is an improvement, as we need to know what *.cs file a given class is coming from. This is because that file will act as the one dependencies will be setup on, ie. for attaching to gameobjects, serialization ect.
Before the behavior could be inconsistent because it would depend on order, now we highlight the issue with a error and can consistently get the same file for a class.