Search Issue Tracker
Duplicate
Votes
5
Found in
2021.2.0a14
Issue ID
1328863
Regression
No
Player crashes at startup if the script attached to GameObject has the public variable
Steps:
1. Open attached project
2. Load CrashExample scene
3. Take a look into Player.cs
==> Should have public FollowState state = new FollowState(); line in it (the variable is public)
4. Build nd Run the player in release mode
==>
Player crashes at startup
Please take a look into attached movie for details
Originally posted in this forum thread
https://forum.unity.com/threads/missing-variables-on-release.1091239/
Also repro in: 2020.2.0a20.2570, 2020.1.0a20.2396
Note: If you remove the ifdef DEBUG in StateMachine<> it will no longer crash.
-
jviruss
Apr 15, 2021 21:35
This bug is in all versions of unity after 2019.3.There is a package in the forum link to reproduce it.It is a problem in unity serialization.This problem crashes unity while it is in deserialization process of variables.Then the scenes can not be loaded by errors in deserialization of variables.
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
- Shadows are not cast when the Light's CullingMask and the GameObject's Layer do not match
- Graphics.DrawMeshInstanced does not work when 2D Renderer and 2D Shaders are used
- SpeedTree does not move when using WindZone
- "Undeclared identifier 'LinearToSRGB'" error is thrown when creating a color variable with HDR color mode and assigning a Custom Render Texture target in Shader Graph
- Input System package is missing when creating a new HDRP project
This is a duplicate of issue #1339423