Search Issue Tracker
By Design
Votes
1
Found in
2017.4.0f1
2018.4.0f1
2019.1.14f1
2019.2.0a1
2019.3.0a1
2020.1.0a1
Issue ID
1186968
Regression
No
Asset will return null even if that Asset exists when calling Resources.Load, but only for the first time
How to reproduce:
1. Open the attached project in editor.
2. Notice the error log "EditorInit could not get the TestScriptable asset" despite the fact that the asset is part of the project.
3. Close and reopen the project.
4. Notice the error log is not present anymore.
- optionally: close the project, delete the /Library folder, reopen the project, notice that the error log is back.
Reproducible with: 2017.4.32f1, 2018.4.10f1, 2019.2.7f2, 2019.3.0b5, 2020.1.0a6
Actual results: Assets return fake null for the first time
Expected results: if the Asset exists it shouldn't return null
Comments (1)
-
mosowskitsg
Aug 14, 2020 23:48
I managed to reproduce this issue on 2020.1.2f1 with simple Resources.Load<GameObject>() call in Start method. Method fails until I do "something complex enough", i.e. change script and recompile or reimport specified prefab.
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note (2019.3.X):
Non scripts can not reliably be loaded from InitializeOnLoad static constructors