Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
0
Found in
5.2.2p1
Issue ID
740896
Regression
No
Making a copy of a struct does not properly copy it's values
Steps to reproduce:
1. Open attached project
2. Inspect 'Test.cs' script, notice it makes a copy of a struct and compares their integer values afterwards
3. Open and play 'Scene'
4. Read the console: The 'copied' value is not 0, but some random value
5. Press 'Stop'
6. Press 'Play' again
7. Read the console again: The 'copied' value is another random value (the value is different with each play)
Expected behaviour: The copied value and the directly read value are always equal (in this case, 0)
Notes:
1. In MonoDevelop console project the issue does not occur (project is in the attached zip)
2. If you move the DoTest() method outside the struct, for example into the monobehaviour, the problem disappears
3. If you use two different structs, one inside the class and one inside the monobehaviour, the problem disappears
4. If you use a class instead of a struct, the problem disappears
Reproduced with: 5.0.4f1, 5.1.4f1, 5.2.2p3, 5.3.0b6
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The UI is not visible when resizing out of focus built Player window with Application.runInBackground set to false
- [Linux] "Error while reading movie" errors are thrown when opening templates
- Standalone profiler process is hidden in macOS dock
- Shader warnings are being thrown after building Mixed Reality Template
- Error is thrown when entering play mode with build profiles docked and standalone profiler open
Add comment