Search Issue Tracker

Active

Under Consideration for 2021.3.X, 2022.3.X, 6000.0.X

Votes

0

Found in

2021.3.39f1

2022.3.33f1

6000.0.6f1

Issue ID

UUM-73999

Regression

No

Cannot revert the Prefab instance to the state of the Prefab Asset when the RequireComponent attribute is connected to the Component in the Prefab

--

-

How to reproduce:
1. Open the “ReproduceBugs“ project
2. Open the “TestScene“
3. Open the “GameObject“ Prefab instance in isolation
4. Add the “testbla“ Script component to the “GameObject“
5. Return to the “GameObject“ Prefab instance edit in context
6. Add the Animator component to the “GameObject“
7. Un-comment the 5th line of code in the “testbla.cs“ script
8. Right-click on the Animator component and choose “Added Component > Revert“

Expected result: No errors are thrown and the “GameObject“ Prefab instance gets reverted to the Prefab state
Actual result: An error “Can't remove Animator because testbla (Script) depends on it. UnityEditor.GenericMenu:CatchMenu (object,string[],int)“ is thrown and the “GameObject“ Prefab instance doesn’t get reverted to the prefab state

Reproducible with: 2021.3.39f1, 2022.3.33f1, 6000.0.6f1

Reproducible on: macOS 14.5 (Intel), Windows 10 Pro (22H2)
Not reproducible on: No other environments tested

Note: Since the Prefab itself has the required Component, reverting to the Prefab state should satisfy the restriction from the RequireComponent attribute

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.