Search Issue Tracker
By Design
Votes
0
Found in
5.4.3f1
Issue ID
880921
Regression
No
Private variable keeps its value after reimporting
To reproduce:
1. Open attached project;
2. Open "Scene" scene;
- Console logs: "Deserialized as 0" and "set to X" (a random number);
3. Reimport "MyScript".
Expected result: after reimporting a Script, private variable "MyProperty" should be set to 0.
Actual result: after reimporting a Script, private variable "MyProperty" is set to a random value it just picked.
Notes:
-This only happens in edit mode and only while the editor is open. Restarting the editor causes "MyProperty" to be set to 0 again.
-With a string property, this also means that Unity initialises it as "" where you would expect a non-serialized property to be null.
Reproducible on versions: 5.3.7p3, 5.4.3f1, 5.5.1p4, 5.6.0b8.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Add comment