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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note (2019.3.X):
Non scripts can not reliably be loaded from InitializeOnLoad static constructors