Search Issue Tracker
Duplicate
Votes
0
Found in
2018.3.0a6
2018.3.2f1
2019.1.0a1
2019.2.0a1
Issue ID
1122560
Regression
Yes
Prefab is returned as null In the Editor if the Prefab has been edited recently
How to reproduce:
1. Open the attached project ("case_1122560-PrefabNull.zip")
2. Open the "Bug" Scene and click on the "Main" object in the Hierarchy
3. In the Inspector Right-click the "Prefab Bug Demonstration" script and select "Test Prefab"
4. Observe the Console Window
5. Open the "Prefab" object and change the "A field to Edit" value to "Test"
6. Close the prefab mode and repeat steps 2&3
7. Observe the Console Window again
Expected result: The prefab is returned as non-null and a debug message "Value of prefab is not null Prefab" is shown
Actual result: The prefab is returned as null and a debug message "Value of prefab is null" is shown
Reproduced in: 2019.2.0a4, 2019.1.0b2, 2018.3.4f1, 2018.3.0a6
Not reproducible in: 2017.4.19f1
Couldn't test with: 2018.3.0a5 (Breaks the prefab scripts and the improved prefabs were yet to be implemented)
Note: Entering Play mode fixes the problem and the script returns the prefab as non-null again
Comments (2)
-
eddietree
Feb 15, 2021 20:05
but it doesn't work anymore, maybe a regression?
-
tweedie
Jan 31, 2019 23:51
This sounds like a duplicate of #1116476 ?
https://issuetracker.unity3d.com/issues/prefabs-references-are-lost-when-modifying-prefab
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
- A NullReferenceException error is thrown when extracting textures from an FBX
- “Convert To Subgraph Operator” option is capitalised incorrectly in VFX Graph
- "Toggle all debug panels" shortcut throws “NullReferenceException: Object reference not set to an instance of an object” error
- Rect Transform values are set to NaN when scaling UI element with centered scaling
- "Local Volumetric Fog" Component's "Inherit from Hierarchy" mode doesn't support negative "Scale" on the "Transform" Component
This is a duplicate of issue #1116476