Search Issue Tracker
Duplicate
Votes
0
Found in
4.3.0b5
Issue ID
569433
Regression
No
Adding component that requeres own base class adds extra component to the object
If you add to object component like this:
[RequireComponent(typeof(B))]
public class A : B {}
Component B will be added to the object.
Object should have only A.
It is not consistant with behavior in similar situations:
a) when A requeres A (then there will be only one A component)
b) when A requeres some other component B1, but object already has component A1 (where A1 inherits B1), B1 will not be added.
After you add A to an empty object, B will be added.
If you try to delete B you'll get an error "A depends on B". So you should delete A first and then B.
But if you add another A, you'll get one component B and two A. Then you can delete B. And after that you can delete one A. Last A cannot be deleted because of the bug 568895
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
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
This is a duplicate of issue #568895