Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4
2019.4.21f1
2020.3
2021.1
2021.2
Issue ID
1318169
Regression
No
The wrong variable value is used when accessing it from a method which is called from another script
Reproduction steps:
1. Download and open the attached project "1318169.zip"
2. Enter Play mode and notice the values logged in the console
3. Exit play mode
4. Open the "Script1" script and change the assigned testVariable value on line 10
5. Enter Play mode and notice the values logged in the console
Expected result: The logged values are both the same as set in step 4
Actual result: The second logged value is the same as it was set once the project was opened
Reproducible with: 2018.4.33f1, 2019.4.23f1, 2020.3.3f1, 2021.1.2f1, 2021.2.0a12
Notes:
Restarting the project or switching scenes solves the issue
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
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
- The build size is larger when Models have Animation Type set to Generic
Resolution Note:
The PrefabInstance present in the scene gets recreated on entering play mode(scene is reloaded) invoking the initializers. While the already in memory prefab remains.