Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4
2020.1
2020.2
2020.2.0a9
Issue ID
1253237
Regression
No
[WebGL] Javascript error is thrown when executing Func<Vector3> func = () => Vector3.zero; in build
How to reproduce:
1. Open user attached project "Bug Reproduce.zip"
2. Build and Run for WebGL
Expected result: No Error is thrown when the build starts playing
Actual result: Javascript error is thrown after the build starts playing
Reproducible with - 2018.4.25f1, 2019.4.4f1, 2020.1.0b16, 2020.2.0a18
Successfully reproduced on: Chrome, Firefox, Opera
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
- The tag adder functionality does not work if a space is entered instead of a name
- Errors thrown in the Console when configuring In-App Purchases package
- Longer Scaler Profile names go out of the"Scaler Profilers" section
- AI Navigation window UI elements overlap when the AI Navigation window is docked and resized
- Editor freezes after some time when using NavMeshQuery::Raycast
Resolution Note (2020.2.X):
A quick stand-alone test showed there was nothing wrong with `Func<Vector3> func = () => Vector3.zero;`. The reason why the given example is crashing is because the "Test" component is on an object that's a child of the camera. GameManager. GameManager gets the Test component via `Test test = Camera.main.gameObject.GetComponent<Test>();`. This is not correct, it should be returning null. I moved the Test component onto the camera, and the example worked correctly. You can set "Enable Exceptions" to "Full" in the Player Settings under Publishing Settings, to get the NullReferenceException that would have revealed the problem.