Search Issue Tracker
By Design
Votes
0
Found in
2018.3.0f2
Issue ID
1122921
Regression
No
Object reference is lost when using PrefabUtility.SaveAsPrefabAssetAndConnect in Play mode
To reproduce:
1. Open the project attached "616073-201830f2-prefab-save.zip", scve
2. In Hierarcy window, sleect GameObject
3. In Inspector window, drag "Main Camera" to Obj property field in Test Prefab Component, apply prefab override
4. Enter Play mode, modify the value of 'Age' and click SaveAsPrefabAssetAndConnect
5. Exit Play mode and check Obj property of GameObject
Expected: prefab reference remains referenced in the property field
Actual: property field is empty (reference lost)
Reproduced in: 2018.3.7f1, 2019.1.0b6, 2019.2.0a7
Note: 2019.2.0a7 throws error when executing:
Save prefab failed.
UnityEngine.Debug:LogError(Object)
TestPrefabInspector:OnInspectorGUI() (at Assets/TestPrefabInspector.cs:25)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
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
- ACES Tonemapping causes banding artifacts and negative values in ColorGradingLUT when HDR is enabled and "High Dynamic Range" Grading mode is selected while Android Platform is used
- Android Player freezes when an Audio Source is playing and an incoming call is picked up and then hung up and the Audio Source is started again
- Green success icon is poorly visible in the light Unity theme
- Incorrect input into the Input Field when using Microsoft IME Japanese
- Multiplayer role "ClientAndServer" is displayed without the spaces in the "Play Mode Scenarios" window
Resolution Note (2019.2.X):
This is by design. A Prefab asset cannot save references to Scene objects but it is valid for an Prefab instance to have a reference to other Scene objects. Note that the blue line in the Inspector stays even after Apply All has been executed (it is still marked as as an override since the value could not be saved to the Prefab).