Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2020.3.X, 2021.1.X
Votes
5
Found in
2020.2.0a19
2020.2.0b6
2021.1
Issue ID
1284595
Regression
Yes
Instanced Prefab gets a Component added when entering the Play Mode after deleting the script with RequiredComponent attribute
How to reproduce:
1. Open the attached "1284595_Repro" project
2. Open the Scene "SampleScene"
3. Open the "Comp" Script (found in the Assets folder) and uncomment the 4th line
4. Drag the "Cube" GameObject from the Hierarchy to the Project window to make it into a Prefab
5. Open the Inspector (Window->General->Inspector)
6. In the Hierarchy select the "Cube" GameObject
7. In the Inspector delete the "Comp" Script and Rigidbody Components
8. Enter the Play Mode
Expected results: The Rigidbody Component is not added
Actual results: The Rigidbody Component is added, the "Error removing component when merging Prefab changes: Can't remove Rigidbody because Comp (Script) depends on it" error is thrown
Reproducible with: 2020.2.0a19, 2020.2.0b11, 2021.1.0a5
Not reproducible with: 2018.4.29f1, 2019.4.14f1, 2020.1.13f1, 2020.2.0a18
Notes:
- If a Component was added to the GameObject before it was turned into the Prefab the issue will not occur
- Any instance of the Prefab will have this issue
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a9
Resolution Note (fix version 2021.1):
Fixed in 2021.1.1f1
Resolution Note (fix version 2020.3):
Fixed in 2020.3.4f1