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
-
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
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
Resolution Note (2019.3.X):
Non scripts can not reliably be loaded from InitializeOnLoad static constructors