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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
This is a duplicate of issue #1237191