Search Issue Tracker
Fixed
Fixed in 6000.0.62f1, 6000.2.5f1, 6000.3.0b2, 6000.4.0a1
Votes
2
Found in
2021.3.53f1
2022.3.63f1
6000.0.52f1
6000.1.11f1
6000.2.0b9
6000.3.0a5
6000.4.0a1
Issue ID
UUM-111102
Regression
No
Error when adding valid MonoBehaviour script to Prefab in Project window
Steps to reproduce:
- Ensure you have a Prefab in the Project Window
- Select the Prefab
- In the Inspector, click Add Component button to create a new script (e.g testScript)
- Observe the console
\\
Actual results: "Error while saving Prefab: 'Assets/Cube.prefab'. You are trying to save a Prefab that contains the script '', which does not derive from MonoBehaviour. This is not allowed. Please change the script to derive from MonoBehaviour or remove it from the GameObject 'Cube'. UnityEditor.PrefabImporterEditor:OnDisable ()"
Expected results: No error should occur if the script inherits from MonoBehaviour. The script should be added to the prefab without issue
\\
Reproducible with versions: 2021.3.53f1, 2022.3.63f1, 6000.0.52f1, 6000.1.11f1, 6000.2.0b9
\\
Tested on (OS): macOS 15.6 Silicon
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android][iOS][UnityPlayerActivity] Legacy InputField.onEndEdit is not called when ending text edit
- Transform corruption and/or crash on PhysX::CreateCharacterController when spawning physics objects into Prefab stages
- UNITY_EDITOR data is Serialized into AssetBundle when building on the active Build Target
- "TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations..." error when changing the Packages "Cache Location" folder
- CompilationPipeline.assemblyCompilationFinished() hangs unity when reloading domain
Add comment