Search Issue Tracker
By Design
Votes
0
Found in
5.3.5f1
Issue ID
805674
Regression
No
Prefab Replace Name Based duplicates all components which can exist in multiple copies on one GO
Reproduction steps:
1. Open the attached project
2. Open the available scene
3. Add a Box collider component to the 'TestCube_prefab' gameobject
4. In the 'TestUpdater' script component 'ReplacePrefabTester' Context Menu, click 'Do It!'
Note: Prefab in Assets has been updated from scene
Result: TestCube_prefab in the Hierarchy now has two of the components added in step 3. Repeating step 4 adds even more.
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
- Memory leak when a lot of UI elements are spawned and despawned
- Warnings are not logged in the Console window when using external code analyzers
- Errors “TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 288“ appear constantly when Prefab is open
- Crash on PPtr<Shader>::operator or NullException errors spammed in console when calling Dispose() on null GraphicsBuffer with baked Reflection Probes
- “EndRenderPass: Not inside a Renderpass” and other Render Graph errors in the Player when Render Graph is enabled and Overlay UI is used
Resolution Note:
In the provided project: PrefabUtility.ReplacePrefab got the prefab instance as a GameObject to create prefab asset from.
Prefab instance has override (Added Component - Box Collider), what happens next:
1. Prefab Asset replaced by GameObject, all the overrides on it become objects in prefab asset
2. All instances of this prefab in the Scene updated
a. First - created an instance equal to prefab asset
b. Second - all the existing overrides applied back to it
That is how the instance gets additional Box Collider: One from an updated prefab asset, second from instance override.