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

Serialization

-

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.

Comments (1)

  1. 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

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.