Search Issue Tracker
Won't Fix
Votes
0
Found in
2022.3.7f1
2023.1.9f1
2023.2.0b5
Issue ID
UUM-46327
Regression
No
List's elements visually display the Script's reference when it actually contains the GameObject's reference after changing serialized field type from GameObject to a Script
Reproduction steps:
1. Open the attached “Repro” project
2. Open the “Assets/Scenes/SampleScene.unity” Scene
3. Select the “Assets/A.prefab” Asset in the Project Window
4. Open the “My Script” Script Component’s Context Menu and select “Observe Issue”
5. Observe outputs in the Console
6. Open the “Assets/My Script.cs” Script in a code editor
7. Comment the 8-9 lines, uncomment the 12-13 lines then save
8. Select the “Assets/A.prefab” Asset in the Project Window
9. Observe that the “My Script” Script Component visually has “B (Potato Script)” references in both fields instead of “B” GameObject
10. Open the “My Script” Script Component’s Context Menu and select “Observe Issue”
11. Observe outputs in the Console
Expected result: List element’s reference is correct and “List: ref is null:False ref is destroyed/invalid:False” is outputted
Actual result: List element doesn’t actually reference the GameObject’s Script and “List: ref is null:False ref is destroyed/invalid:True” is outputted
Reproducible with: 2022.3.7f1, 2023.1.9f1, 2023.2.0b5
Couldn’t test with: 2021.3.29f1 (different behavior)
Reproducible on: Windows 10 Pro (22H2)
Not reproducible on: No other environment tested
Note: Using 2021.3.29f1 instead of the Editor automatically assigning the Script reference instead of the GameObject when the field type is changed, the Editor retains the GameObject reference and displays “Type mismatch” in the Inspector window’s field, which is technically correct behavior
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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
Thank you for reporting a bug to Unity.
We have reviewed the issue carefully, and in this case, the team is unable to prioritize fixing this bug. There are a number of reasons we make this decision, including the impact and severity of the issue across our user and customer base, and the possibility that future plans may solve the problem in a different way, or that a workaround for the bug may be available.
Today we will be closing this case. Thank you again for taking the time to report this issue, and please let us know if there is anything else that changes the impact or severity of this issue.