Search Issue Tracker
Duplicate
Votes
2
Found in
2019.4
2020.1.6f1
2020.2
Issue ID
1279300
Regression
No
SerializedReference GameObject property gets set to null after entering Play mode
How to reproduce:
1. Open the user's attached project
2. From the 'Scenes' folder open the 'SampleScene'
3. In the Hierarchy window select the 'ExampleGameObject' object
4. In the Inspector window click the round button on the right of the 'Example Prefab' variable slot
5. In the 'Select GameObject' window select the 'ExamplePrefab'
6. Enter the Play mode
Expected result: The 'ExamplePrefab' field's value doesn't become null
Actual result: The 'ExamplePrefab' field's value becomes null
Reproducible with: 2019.4.11f1, 2020.1.6f1, 2020.2.0b2
Cannot test with: 2018.4.27f1 (due to errors)
Comments (1)
-
Erdrik_Ironrose
Sep 22, 2020 12:47
To note, I tried changing the UnityGameObjectPrefabPropertyDrawer to see if it was a problem with the binding path.
I have tried:
- using prefabField.BindProperty(prefabProperty) instead of setting the .bindingPath.
- using RegisterCallback and directly setting the .managedReferenceValue to a new instance, with the new value set and applying modified properties to the serialized object.Neither approach worked, although using the RegisterCallback also caused an ambiguous error in the console:
"Could not udpate a managed instance value at property path 'examplePrefab', with value '1'" (including the typo in update).
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
This is a duplicate of issue #1237191