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
- Sprite Mode defaults to "Multiple" instead of "Single" when switching the Texture Type to "Sprite (2D and UI)"
- Adaptive Probe Volume “Open” button closes the existing RPAsset window and opens a new RPAsset window instead of focusing the existing RPAsset window
- A specific project freezes when Content Size Fitter's Horizontal Fit is set to "Min Size" and it contains double ellipses followed by a CJK character
- [Android][iOS] The Input field caret moves back to the end of the text when typing
- Custom attribute type is not preserved when inserting a template to the VFX
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.