Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2021.3.28f1
2022.3.5f1
2023.1.4f1
2023.2.0a23
Issue ID
UUM-42808
Regression
No
[HideInInspector] variable's value is overwritten when the variable previously was Public and set up via Inspector
How to reproduce:
1. Open the attached project “HideBug”
2. Open the “SampleScene” scene
3. In the Hierarchy select the “GameObject” GameObject
4. In the Inspector under the “Test” Script check the “Wow” variable
5. Open the “test” Script and uncomment the [HideInInspector] line
6. Enter the Play Mode
7. Observe the Console
Expected result: “False” is logged into the Console because this value is set in the Script
Actual result: “True” is logged into the Console because this value was previously set in the Inspector
Reproducible with: 2021.3.28f1, 2022.3.5f1, 2023.1.4f1, 2023.2.0a23
Reproducible on: Windows 11 Pro
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
HideInInspector does not change the value of the serialized field, which is saved with the scene. If you use [System.NonSerialized] instead, it will not show in the inspector and behave in the way you expect.
Resolution Note (2023.2.X):
HideInInspector does not change the value of the serialized field, which is saved with the scene. If you use [System.NonSerialized] instead, it will not show in the inspector and behave in the way you expect.